[Swift-devel] Double loop, please suggest options:

Tiberiu Stef-Praun tiberius at ci.uchicago.edu
Tue Feb 27 11:08:35 CST 2007


type file {}

//define the wavelet procedure
(file wavelets) waveletTransf (file waveletScript, int subjNo, string
trialType, file dataFiles) {
    app {
        cwtPacksmall @filename(waveletScript) subjNo trialType
@filename(wavelets);
    }
}

(file outputs[]) batchTrials ( string trialTypes[], string subjectNo[] ){
    file waveletScript<fixed_mapper; file="scripts/runTrialSubjectWavelet.R">;

    foreach string t,j in subjectNo {
        foreach string s,i in trialTypes {
            //example 101.FB.tgz (I can name this in any way,
            //I still need to have the subjectNo and trialTypes in the
name, for clarity purposes)
            // SUGGEST HERE
            file output<simple_mapper;prefix=s,suffix="101.tgz">;
            // example: 101.FB (this is a symlink from the original input file)
            file dataFiles<simple_mapper; prefix=t, suffix=s>;
            output = waveletTransf(waveletScript,t,s,dataFiles);
            //SUGGEST HERE
            outputs[i*j]=output;
        }
    }
}

//string subjectNo[]=["101"];
string subjectNo[]=
["101","102","103","104","105","107","110","111","112","113","114","115","116","117","118",120","121",122","124","126","128","129","130","131","132","133","134","135","137","137","138","139","140"];
string trialTypes[] = ["FB", "FC", "FI", "SB", "SC", "SI" ];
//string trialTypes[] = [ "FB", "FC" ];

//SUGGEST HERE
file outputs[]<fixed_array_mapper; files= ...>

outputs = batchTrials (trialTypes, sybjectNo);


-- 
Tiberiu (Tibi) Stef-Praun, PhD
Research Staff, Computation Institute
5640 S. Ellis Ave, #405
University of Chicago
http://www-unix.mcs.anl.gov/~tiberius/



More information about the Swift-devel mailing list