diff --git a/src/ArgList.cpp b/src/ArgList.cpp index a593486c64..b7c3dcc35d 100644 --- a/src/ArgList.cpp +++ b/src/ArgList.cpp @@ -207,6 +207,13 @@ void ArgList::RemoveFirstArg() { marked_.erase( marked_.begin() ); } +/** Replace argument at position with given argument. Update ArgLine. */ +void ArgList::ChangeArg(unsigned int idx, std::string const& arg) { + size_t pos = argline_.find( arglist_[idx], 0 ); + argline_.replace(pos, arglist_[idx].size(), arg); + arglist_[idx] = arg; +} + // ArgList::Command() /* \return pointer to the first argument */ @@ -440,7 +447,6 @@ bool ArgList::hasKey(const char *key) { /** \param key string to search for * \return true if key is found, false if not. */ -// NOTE: Should this be ignoring previously marked strings? bool ArgList::Contains(const char *key) const { for (unsigned int arg = 0; arg < arglist_.size(); arg++) if (!marked_[arg]) { diff --git a/src/ArgList.h b/src/ArgList.h index a3bbfa4f4e..1d2fa0a2db 100644 --- a/src/ArgList.h +++ b/src/ArgList.h @@ -40,6 +40,7 @@ class ArgList { bool empty() const { return arglist_.empty(); } /// \return the argument string const char *ArgLine() const { return argline_.c_str(); } + std::string const& ArgLineStr() const { return argline_; } /// \return all unmarked arguments as a string std::string ArgString() const; /// Clear list @@ -60,6 +61,8 @@ class ArgList { void PrintDebug() const; /// Remove the first argument void RemoveFirstArg(); + /// Change argument at position to new argument + void ChangeArg(unsigned int, std::string const&); /// \return the first argument const char *Command() const; /// \return true if the first argument matches key @@ -86,7 +89,7 @@ class ArgList { double getKeyDouble(const char*, double); /// \return true if the key is present in the list bool hasKey(const char*); - /// \return true if they key is in the list but do not mark. + /// \return true if they key is in the list and unmarked; do not mark. bool Contains(const char*) const; private: /// Empty string to return when args not found diff --git a/src/Cmd.h b/src/Cmd.h index 8669fee3c7..acfb96efbe 100644 --- a/src/Cmd.h +++ b/src/Cmd.h @@ -11,8 +11,8 @@ class Cmd { public: typedef std::vector< std::string > Sarray; // TODO put in common header? - /// Command destinations. EXEcute, ACTion, ANAlysis, DEPrecated. - enum DestType { EXE = 0, ACT, ANA, DEP }; + /// Command destinations. EXEcute, ACTion, ANAlysis, ConTroL, BLocK, DEPrecated. + enum DestType { EXE = 0, ACT, ANA, CTL, BLK, DEP }; /// CONSTRUCTOR Cmd() : object_(0), dest_(EXE) {} /// CONSTRUCTOR - takes destination, DispatchObject pointer, and keywords. diff --git a/src/Command.cpp b/src/Command.cpp index 0fe5961e79..a62df81b62 100644 --- a/src/Command.cpp +++ b/src/Command.cpp @@ -1,3 +1,4 @@ +#include // isalnum #include #include // std::sort() #include "Command.h" @@ -6,6 +7,7 @@ #include "CmdInput.h" // ProcessInput() #include "RPNcalc.h" #include "Deprecated.h" +#include "Control.h" // ----- GENERAL --------------------------------------------------------------- #include "Exec_Analyze.h" #include "Exec_Calc.h" @@ -173,6 +175,12 @@ const Cmd Command::EMPTY_ = Cmd(); Command::Carray Command::names_ = Command::Carray(); +Command::CtlArray Command::control_ = Command::CtlArray(); + +int Command::ctlidx_ = -1; + +VariableArray Command::CurrentVars_ = VariableArray(); + /** Initialize all commands. Should only be called once as program starts. */ void Command::Init() { // GENERAL @@ -193,6 +201,7 @@ void Command::Init() { Command::AddCmd( new Exec_NoProgress(), Cmd::EXE, 1, "noprogress" ); Command::AddCmd( new Exec_Precision(), Cmd::EXE, 1, "precision" ); Command::AddCmd( new Exec_PrintData(), Cmd::EXE, 1, "printdata" ); + Command::AddCmd( new Exec_QuietBlocks(), Cmd::EXE, 1, "quietblocks" ); Command::AddCmd( new Exec_Quit(), Cmd::EXE, 2, "exit", "quit" ); Command::AddCmd( new Exec_ReadData(), Cmd::EXE, 1, "readdata" ); Command::AddCmd( new Exec_ReadInput(), Cmd::EXE, 1, "readinput" ); @@ -364,6 +373,10 @@ void Command::Init() { Command::AddCmd( new Analysis_Timecorr(), Cmd::ANA, 1, "timecorr" ); Command::AddCmd( new Analysis_VectorMath(), Cmd::ANA, 1, "vectormath" ); Command::AddCmd( new Analysis_Wavelet(), Cmd::ANA, 1, "wavelet" ); + // CONTROL STRUCTURES + Command::AddCmd( new ControlBlock_For(), Cmd::BLK, 1, "for" ); + Command::AddCmd( new Control_Set(), Cmd::CTL, 1, "set" ); + Command::AddCmd( new Control_Show(), Cmd::CTL, 1, "show" ); // DEPRECATED COMMANDS Command::AddCmd( new Deprecated_AvgCoord(), Cmd::DEP, 1, "avgcoord" ); Command::AddCmd( new Deprecated_DihScan(), Cmd::DEP, 1, "dihedralscan" ); @@ -378,8 +391,21 @@ void Command::Init() { names_.push_back( 0 ); } -/** Free all commands. Should only be called just before program exit. */ -void Command::Free() { commands_.Clear(); } +/** Clear any existing control blocks. */ +void Command::ClearControlBlocks() { + for (CtlArray::iterator it = control_.begin(); it != control_.end(); ++it) + delete *it; + control_.clear(); + ctlidx_ = -1; +} + +/** Free all commands. Should only be called just before program exit. Also + * remove any remaining control blocks. + */ +void Command::Free() { + commands_.Clear(); + ClearControlBlocks(); +} /** \param oIn Pointer to DispatchObject to add as command. * \param dIn Command destination @@ -403,17 +429,23 @@ void Command::AddCmd(DispatchObject* oIn, Cmd::DestType dIn, int nKeys, ...) { } /** Search Commands list for command with given keyword and object type. */ -Cmd const& Command::SearchTokenType(DispatchObject::Otype catIn, const char* keyIn) +Cmd const& Command::SearchTokenType(DispatchObject::Otype catIn, const char* keyIn, + bool silent) { for (CmdList::const_iterator cmd = commands_.begin(); cmd != commands_.end(); ++cmd) { if (catIn != cmd->Obj().Type()) continue; if (cmd->KeyMatches(keyIn)) return *cmd; } - mprinterr("'%s': Command not found.\n", keyIn); + if (!silent) mprinterr("'%s': Command not found.\n", keyIn); return EMPTY_; } +/** Search Commands list for command with given keyword and object type. */ +Cmd const& Command::SearchTokenType(DispatchObject::Otype catIn, const char* keyIn) { + return SearchTokenType(catIn, keyIn, false); +} + /** Search the Commands list for given command. * \return the token if found, 0 if not. */ @@ -467,31 +499,159 @@ void Command::ListCommands(DispatchObject::Otype typeIn) { ListCommandsForType( typeIn ); } -/** Search for the given command and execute it. EXE commands are executed - * immediately and then freed. ACT and ANA commands are sent to the - * CpptrajState for later execution. +/** \return true if any control blocks remain. */ +bool Command::UnterminatedControl() { + if (!control_.empty()) { + mprinterr("Error: %u unterminated control block(s) detected.\n", ctlidx_+1); + for (int i = 0; i <= ctlidx_; i++) + mprinterr("Error: %i : %s\n", i, control_[i]->Description().c_str()); + return true; + } + return false; +} + +/** Create new control block with given Block. */ +int Command::AddControlBlock(ControlBlock* ctl, CpptrajState& State, ArgList& cmdArg) { + if ( ctl->SetupBlock( State, cmdArg ) ) + return 1; + if (ctlidx_ == -1) mprintf("CONTROL: Starting control block.\n"); + control_.push_back( ctl ); + ctlidx_++; + mprintf(" BLOCK %2i: ", ctlidx_); + for (int i = 0; i < ctlidx_; i++) + mprintf(" "); + mprintf("%s\n", ctl->Description().c_str()); + //mprintf("DEBUG: Begin control block %i\n", ctlidx_); + return 0; +} + +#define NEW_BLOCK "__NEW_BLOCK__" +/** Execute the specified control block. */ +int Command::ExecuteControlBlock(int block, CpptrajState& State) +{ + control_[block]->Start(); + ControlBlock::DoneType ret = control_[block]->CheckDone(CurrentVars_); + if (State.Debug() > 0) { + mprintf("DEBUG: Start: CurrentVars:"); + CurrentVars_.PrintVariables(); + } + while (ret == ControlBlock::NOT_DONE) { + for (ControlBlock::const_iterator it = control_[block]->begin(); + it != control_[block]->end(); ++it) + { + if (it->CommandIs(NEW_BLOCK)) { + // Execute next control block + if (ExecuteControlBlock(block+1, State)) return 1; + } else { + for (int i = 0; i < block; i++) mprintf(" "); + // Execute command + if ( ExecuteCommand(State, *it) != CpptrajState::OK ) return 1; + } + } + ret = control_[block]->CheckDone(CurrentVars_); + } + if (ret == ControlBlock::ERROR) return 1; + return 0; +} + +/** Handle the given command. If inside a control block, if the command is + * a control command a new block will be created, otherwise the command will + * be added to the current control block. Once all control blocks are + * complete they will be executed. If not inside a control block, just + * execute the command. */ CpptrajState::RetType Command::Dispatch(CpptrajState& State, std::string const& commandIn) { ArgList cmdArg( commandIn ); - cmdArg.MarkArg(0); // Always mark the first arg as the command + cmdArg.MarkArg(0); // Always mark the first arg as the command + // Check for control block + if (!control_.empty()) { + mprintf(" [%s]\n", cmdArg.ArgLine()); + // In control block. + if ( control_[ctlidx_]->EndBlock( cmdArg ) ) { + // End the current control block. + //mprintf("DEBUG: End control block %i.\n", ctlidx_); + mprintf(" BLOCK %2i: ", ctlidx_); + for (int i = 0; i < ctlidx_; i++) + mprintf(" "); + mprintf("END\n"); + ctlidx_--; + if (ctlidx_ < 0) { + // Outermost control structure is ended. Execute control block(s). + mprintf("CONTROL: Executing %u control block(s).\n", control_.size()); + if (State.QuietBlocks()) SetWorldSilent(true); + int cbret = ExecuteControlBlock(0, State); + ClearControlBlocks(); + if (State.QuietBlocks()) SetWorldSilent(false); + if (cbret != 0) return CpptrajState::ERR; + mprintf("CONTROL: Control block finished.\n\n"); + } + } else { + // Check if this is another control block statement (silently) + Cmd const& ctlCmd = SearchTokenType(DispatchObject::CONTROL, cmdArg.Command(), true); + if (ctlCmd.Empty() || ctlCmd.Destination() != Cmd::BLK) { // TODO just check Destination? + // Add this command to current control block. + control_[ctlidx_]->AddCommand( cmdArg ); + mprintf("\tAdded command '%s' to control block %i.\n", cmdArg.Command(), ctlidx_); + } else { + // Tell current block that a new block is being created + control_[ctlidx_]->AddCommand(NEW_BLOCK); + // Create new control block + DispatchObject* obj = ctlCmd.Alloc(); + if (AddControlBlock( (ControlBlock*)obj, State, cmdArg )) { + delete obj; + ClearControlBlocks(); + return CpptrajState::ERR; + } + } + } + return CpptrajState::OK; + } + return ExecuteCommand( State, cmdArg ); +} + +#undef NEW_BLOCK + +/** Search for the given command and execute it. Replace any variables in + * command with their values. EXE and CTL commands are executed immediately + * and then freed. ACT and ANA commands are sent to the CpptrajState for later + * execution. BLK commands set up control blocks which will be executed when + * the outer control block is completed. + */ +CpptrajState::RetType Command::ExecuteCommand( CpptrajState& State, ArgList const& cmdArgIn ) { + // Replace variable names in command with entries from CurrentVars + ArgList cmdArg = CurrentVars_.ReplaceVariables( cmdArgIn, State.DSL(), State.Debug() ); + if (cmdArg.empty()) return CpptrajState::ERR; + // Print modified command + mprintf(" [%s]\n", cmdArg.ArgLine()); + // Look for command in command list. Cmd const& cmd = SearchToken( cmdArg ); CpptrajState::RetType ret_val = CpptrajState::OK; if (cmd.Empty()) { - // Try to evaluate the expression + // Not a command. Try to evaluate the expression RPNcalc calc; calc.SetDebug( State.Debug() ); - if (calc.ProcessExpression( commandIn )) + if (calc.ProcessExpression( cmdArg.ArgLineStr() )) ret_val = CpptrajState::ERR; else { if (calc.Evaluate( State.DSL() )) ret_val = CpptrajState::ERR; } if (ret_val == CpptrajState::ERR) - mprinterr("'%s': Invalid command or expression.\n", commandIn.c_str()); + mprinterr("'%s': Invalid command or expression.\n", cmdArg.ArgLine()); } else { DispatchObject* obj = cmd.Alloc(); switch (cmd.Destination()) { + case Cmd::CTL: + ret_val = ((Control*)obj)->SetupControl(State, cmdArg, CurrentVars_); + delete obj; + break; + case Cmd::BLK: + if (AddControlBlock( (ControlBlock*)obj, State, cmdArg )) { + delete obj; + return CpptrajState::ERR; + } + break; case Cmd::EXE: ret_val = ((Exec*)obj)->Execute( State, cmdArg ); delete obj; @@ -530,8 +690,6 @@ CpptrajState::RetType Command::ProcessInput(CpptrajState& State, std::string con } // Only attempt to execute if the command is not blank. if (!input.Empty()) { - // Print the input line that will be sent to dispatch - mprintf(" [%s]\n", input.str()); # ifdef TIMER Timer time_cmd; // DEBUG time_cmd.Start(); // DEBUG diff --git a/src/Command.h b/src/Command.h index 4f2dd7662c..2d9ea426b7 100644 --- a/src/Command.h +++ b/src/Command.h @@ -2,18 +2,19 @@ #define INC_COMMAND_H #include "CmdList.h" #include "CpptrajState.h" +#include "Control.h" class Command { public: static void Init(); static void Free(); /// List commands of given type, or all if type is NONE static void ListCommands(DispatchObject::Otype); - /// Add a command to the list of commands - static void AddCmd(DispatchObject*, Cmd::DestType, int, ...); /// \return command corresponding to first argument in ArgList. static Cmd const& SearchToken(ArgList&); /// \return command of given type corresponding to given command key. static Cmd const& SearchTokenType(DispatchObject::Otype, const char*); + /// \return true if unterminated control block(s) exist. + static bool UnterminatedControl(); /// Execute command, modifies given CpptrajState static CpptrajState::RetType Dispatch(CpptrajState&, std::string const&); /// Read input commands from given file, modifies given CpptrajState. @@ -21,11 +22,29 @@ class Command { /// \return Pointer to command name address. static const char* CmdToken(int idx) { return names_[idx]; } private: + /// Add a command to the list of commands + static void AddCmd(DispatchObject*, Cmd::DestType, int, ...); + /// Search for command of given type with given name; can be silent. + static Cmd const& SearchTokenType(DispatchObject::Otype, const char*, bool); + /// List all commands for given type static void ListCommandsForType(DispatchObject::Otype); + /// Clear all existing control blocks + static void ClearControlBlocks(); + /// Add a new control block + static int AddControlBlock(ControlBlock*, CpptrajState&, ArgList&); + /// Execute specified control block + static int ExecuteControlBlock(int, CpptrajState&); + /// Execute given command + static CpptrajState::RetType ExecuteCommand(CpptrajState&, ArgList const&); static CmdList commands_; ///< Master list of commands. static const Cmd EMPTY_; ///< Empty command. typedef std::vector Carray; - static Carray names_; ///< Array of pointers to all command names, for ReadLine + static Carray names_; ///< Array of pointers to all command names, for ReadLine + typedef std::vector CtlArray; + static CtlArray control_; ///< Array of control blocks + static int ctlidx_; ///< Point to current control block + /// Array of script variables and their current values. + static VariableArray CurrentVars_; }; #endif diff --git a/src/Control.cpp b/src/Control.cpp new file mode 100644 index 0000000000..c316a72be9 --- /dev/null +++ b/src/Control.cpp @@ -0,0 +1,408 @@ +#include // std::min +#include "Control.h" +#include "CpptrajStdio.h" +#include "StringRoutines.h" + +void ControlBlock_For::Help() const { + mprintf("\t{ {atoms|residues|molecules|molfirstres|mollastres}\n" + "\t inmask [%s] ... |\n" + "\t =;[;][] ... }\n", + DataSetList::TopIdxArgs); + mprintf("\tEND KEYWORD: 'done'\n"); + mprintf(" Create a 'for' loop around specified mask(s) and/or integer value(s).\n" + " Any number and combination of masks and integers can be specified.\n" + " Variables created in the for loop can be referenced by prefacing\n" + " the name with a '$' character.\n" + " Available 'end OP' : '<' '>'\n" + " Available 'increment OP' : '++', '--', '+=', '-='\n" + " Note that variables are NOT incremented after the final loop iteration,\n" + " i.e. loop variables always retain their final value.\n" + " Example:\n" + "\tfor atoms A0 inmask :1-27&!@H= i=1;i++\n" + "\t distance d$i :TCS $A0 out $i.dat\n" + "\tdone\n"); +} + +/** Set up each mask/integer loop. */ +int ControlBlock_For::SetupBlock(CpptrajState& State, ArgList& argIn) { + mprintf(" Setting up 'for' loop.\n"); + Vars_.clear(); + Topology* currentTop = 0; + static const char* TypeStr[] = { "ATOMS ", "RESIDUES ", "MOLECULES ", + "MOL_FIRST_RES ", "MOL_LAST_RES " }; + static const char* OpStr[] = {"+=", "-=", "<", ">"}; + description_.assign("for ("); + int MaxIterations = -1; + int iarg = 0; + while (iarg < argIn.Nargs()) + { + // Advance to next unmarked argument. + while (iarg < argIn.Nargs() && argIn.Marked(iarg)) iarg++; + if (iarg == argIn.Nargs()) break; + // Determine 'for' type + ForType ftype = UNKNOWN; + bool isMaskFor = true; + if ( argIn[iarg] == "atoms" ) ftype = ATOMS; + else if ( argIn[iarg] == "residues" ) ftype = RESIDUES; + else if ( argIn[iarg] == "molecules" ) ftype = MOLECULES; + else if ( argIn[iarg] == "molfirstres" ) ftype = MOLFIRSTRES; + else if ( argIn[iarg] == "mollastres" ) ftype = MOLLASTRES; + else if ( argIn[iarg].find(";") != std::string::npos ) { + isMaskFor = false; + ftype = INTEGER; + } + if (ftype == UNKNOWN) { + mprinterr("Error: for loop type not specfied.\n"); + return 1; + } + argIn.MarkArg(iarg); + Vars_.push_back( LoopVar() ); + LoopVar& MH = Vars_.back(); + int Niterations = -1; + // Set up for specific type + if (description_ != "for (") description_.append(", "); + // ------------------------------------------- + if (isMaskFor) + { + // {atoms|residues|molecules} inmask [TOP KEYWORDS] + if (argIn[iarg+2] != "inmask") { + mprinterr("Error: Expected 'inmask', got %s\n", argIn[iarg+2].c_str()); + return 1; + } + AtomMask currentMask; + if (currentMask.SetMaskString( argIn.GetStringKey("inmask") )) return 1; + MH.varType_ = ftype; + Topology* top = State.DSL().GetTopByIndex( argIn ); + if (top != 0) currentTop = top; + if (currentTop == 0) return 1; + MH.varname_ = argIn.GetStringNext(); + if (MH.varname_.empty()) { + mprinterr("Error: 'for inmask': missing variable name.\n"); + return 1; + } + MH.varname_ = "$" + MH.varname_; + // Set up mask + if (currentTop->SetupIntegerMask( currentMask )) return 1; + currentMask.MaskInfo(); + if (currentMask.None()) return 1; + // Set up indices + if (MH.varType_ == ATOMS) + MH.Idxs_ = currentMask.Selected(); + else if (MH.varType_ == RESIDUES) { + int curRes = -1; + for (AtomMask::const_iterator at = currentMask.begin(); at != currentMask.end(); ++at) { + int res = (*currentTop)[*at].ResNum(); + if (res != curRes) { + MH.Idxs_.push_back( res ); + curRes = res; + } + } + } else if (MH.varType_ == MOLECULES || + MH.varType_ == MOLFIRSTRES || + MH.varType_ == MOLLASTRES) + { + int curMol = -1; + for (AtomMask::const_iterator at = currentMask.begin(); at != currentMask.end(); ++at) { + int mol = (*currentTop)[*at].MolNum(); + if (mol != curMol) { + if (MH.varType_ == MOLECULES) + MH.Idxs_.push_back( mol ); + else { + int res; + if (MH.varType_ == MOLFIRSTRES) + res = (*currentTop)[ currentTop->Mol( mol ).BeginAtom() ].ResNum(); + else // MOLLASTRES + res = (*currentTop)[ currentTop->Mol( mol ).EndAtom()-1 ].ResNum(); + MH.Idxs_.push_back( res ); + } + curMol = mol; + } + } + } + Niterations = (int)MH.Idxs_.size(); + description_.append(std::string(TypeStr[MH.varType_]) + + MH.varname_ + " inmask " + currentMask.MaskExpression()); + // ------------------------------------------- + } else if (ftype == INTEGER) { + // [=;[;][]] + MH.varType_ = ftype; + ArgList varArg( argIn[iarg], ";" ); + if (varArg.Nargs() < 2 || varArg.Nargs() > 3) { + mprinterr("Error: Malformed 'for' loop variable.\n" + "Error: Expected '[=;[;][]]'\n" + "Error: Got '%s'\n", argIn[iarg].c_str()); + return 1; + } + // First argument: = + ArgList startArg( varArg[0], "=" ); + if (startArg.Nargs() != 2) { + mprinterr("Error: Malformed 'start' argument.\n" + "Error: Expected =, got '%s'\n", varArg[0].c_str()); + return 1; + } + MH.varname_ = startArg[0]; + if (!validInteger(startArg[1])) { + // TODO allow variables + mprinterr("Error: Start argument must be an integer.\n"); + return 1; + } else + MH.start_ = convertToInteger(startArg[1]); + // Second argument: + size_t pos0 = MH.varname_.size(); + size_t pos1 = pos0 + 1; + MH.endOp_ = NO_OP; + int iargIdx = 1; + if (varArg.Nargs() == 3) { + iargIdx = 2; + if ( varArg[1][pos0] == '<' ) + MH.endOp_ = LESS_THAN; + else if (varArg[1][pos0] == '>') + MH.endOp_ = GREATER_THAN; + if (MH.endOp_ == NO_OP) { + mprinterr("Error: Unrecognized end op: '%s'\n", + varArg[1].substr(pos0, pos1-pos0).c_str()); + return 1; + } + std::string endStr = varArg[1].substr(pos1); + if (!validInteger(endStr)) { + // TODO allow variables + mprinterr("Error: End argument must be an integer.\n"); + return 1; + } else + MH.end_ = convertToInteger(endStr); + } + // Third argument: [] + pos1 = pos0 + 2; + MH.incOp_ = NO_OP; + bool needValue = false; + if ( varArg[iargIdx][pos0] == '+' ) { + if (varArg[iargIdx][pos0+1] == '+') { + MH.incOp_ = INCREMENT; + MH.inc_ = 1; + } else if (varArg[iargIdx][pos0+1] == '=') { + MH.incOp_ = INCREMENT; + needValue = true; + } + } else if ( varArg[iargIdx][pos0] == '-' ) { + if (varArg[iargIdx][pos0+1] == '-' ) { + MH.incOp_ = DECREMENT; + MH.inc_ = 1; + } else if (varArg[iargIdx][pos0+1] == '=') { + MH.incOp_ = DECREMENT; + needValue = true; + } + } + if (MH.incOp_ == NO_OP) { + mprinterr("Error: Unrecognized increment op: '%s'\n", + varArg[iargIdx].substr(pos0, pos1-pos0).c_str()); + return 1; + } + if (needValue) { + std::string incStr = varArg[iargIdx].substr(pos1); + if (!validInteger(incStr)) { + mprinterr("Error: increment value is not a valid integer.\n"); + return 1; + } + MH.inc_ = convertToInteger(incStr); + if (MH.inc_ < 1) { + mprinterr("Error: Extra '-' detected in increment.\n"); + return 1; + } + } + // Description + MH.varname_ = "$" + MH.varname_; + std::string sval = integerToString(MH.start_); + description_.append("(" + MH.varname_ + "=" + sval + "; "); + std::string eval; + if (iargIdx == 2) { + // End argument present + eval = integerToString(MH.end_); + description_.append(MH.varname_ + std::string(OpStr[MH.endOp_]) + eval + "; "); + // Check end > start for increment, start > end for decrement + int maxval, minval; + if (MH.incOp_ == INCREMENT) { + if (MH.start_ >= MH.end_) { + mprinterr("Error: start must be less than end for increment.\n"); + return 1; + } + minval = MH.start_; + maxval = MH.end_; + } else { + if (MH.end_ >= MH.start_) { + mprinterr("Error: end must be less than start for decrement.\n"); + return 1; + } + minval = MH.end_; + maxval = MH.start_; + } + // Figure out number of iterations + Niterations = (maxval - minval) / MH.inc_; + if (((maxval-minval) % MH.inc_) > 0) Niterations++; + } + description_.append( MH.varname_ + std::string(OpStr[MH.incOp_]) + + integerToString(MH.inc_) + ")" ); + // If decrementing just negate value + if (MH.incOp_ == DECREMENT) + MH.inc_ = -MH.inc_; + // DEBUG + //mprintf("DEBUG: start=%i endOp=%i end=%i incOp=%i val=%i startArg=%s endArg=%s\n", + // MH.start_, (int)MH.endOp_, MH.end_, (int)MH.incOp_, MH.inc_, + // MH.startArg_.c_str(), MH.endArg_.c_str()); + } + // Check number of values + if (MaxIterations == -1) + MaxIterations = Niterations; + else if (Niterations != -1 && Niterations != MaxIterations) { + mprintf("Warning: # iterations %i != previous # iterations %i\n", + Niterations, MaxIterations); + MaxIterations = std::min(Niterations, MaxIterations); + } + } + mprintf("\tLoop will execute for %i iterations.\n", MaxIterations); + if (MaxIterations < 1) { + mprinterr("Error: Loop has less than 1 iteration.\n"); + return 1; + } + description_.append(") do"); + + return 0; +} + +/** For each mask initialize iterator. For each integer set to start value. */ +void ControlBlock_For::Start() { + for (Marray::iterator MH = Vars_.begin(); MH != Vars_.end(); ++MH) { + if (MH->varType_ == INTEGER) + MH->currentVal_ = MH->start_; // TODO search currentvars + else + MH->idx_ = MH->Idxs_.begin(); + } +} + +/** For each mask check if done, then update CurrentVars, then increment. */ +ControlBlock::DoneType ControlBlock_For::CheckDone(Varray& CurrentVars) { + static const char* prefix[] = {"@", ":", "^", ":", ":"}; + for (Marray::iterator MH = Vars_.begin(); MH != Vars_.end(); ++MH) { + // Exit as soon as one is done TODO check all? + if (MH->varType_ == INTEGER) { + if (MH->endOp_ == LESS_THAN) { + if (MH->currentVal_ >= MH->end_) return DONE; + } else if (MH->endOp_ == GREATER_THAN) { + if (MH->currentVal_ <= MH->end_) return DONE; + } + // Get variable value and update CurrentVars + CurrentVars.UpdateVariable( MH->varname_, integerToString( MH->currentVal_ )); + // Increment + MH->currentVal_ += MH->inc_; + } else { + if (MH->idx_ == MH->Idxs_.end()) return DONE; + // Get variable value + std::string maskStr = prefix[MH->varType_] + integerToString(*(MH->idx_) + 1); + //mprintf("DEBUG: ControlBlock_For: %s\n", maskStr.c_str()); + // Update CurrentVars + CurrentVars.UpdateVariable( MH->varname_, maskStr ); + // Increment + ++(MH->idx_); + } + } + return NOT_DONE; +} + +// ============================================================================= +void Control_Set::Help() const { + mprintf("\t{ |\n" + "\t {atoms|residues|molecules} inmask \n" + "\t [%s]\n" + "\t trajinframes }\n", + DataSetList::TopIdxArgs); + mprintf(" Set ( = '=') or append ( = '+=') a script variable.\n" + " - Set script variable to value .\n" + " - Set script variable to the number of atoms/residues/molecules in\n" + " the given atom mask.\n" + " - Set script variable to the current number of frames that will\n" + " be read from all previous 'trajin' statements.\n"); +} + +/** Set up variable with value. In this case allow any amount of whitespace, + * so re-tokenize the original argument line (minus the command). + */ +CpptrajState::RetType + Control_Set::SetupControl(CpptrajState& State, ArgList& argIn, Varray& CurrentVars) +{ + ArgList remaining = argIn.RemainingArgs(); + size_t pos0 = remaining.ArgLineStr().find_first_of("="); + if (pos0 == std::string::npos) { + mprinterr("Error: Expected =\n"); + return CpptrajState::ERR; + } + size_t pos1 = pos0; + bool append = false; + if (pos0 > 0 && remaining.ArgLineStr()[pos0-1] == '+') { + pos0--; + append = true; + } + std::string variable = NoWhitespace( remaining.ArgLineStr().substr(0, pos0) ); + if (variable.empty()) { + mprinterr("Error: No variable name.\n"); + return CpptrajState::ERR; + } + ArgList equals( NoLeadingWhitespace(remaining.ArgLineStr().substr(pos1+1)) ); + std::string value; + if (equals.Contains("inmask")) { + AtomMask mask( equals.GetStringKey("inmask") ); + Topology* top = State.DSL().GetTopByIndex( equals ); + if (top == 0) return CpptrajState::ERR; + if (top->SetupIntegerMask( mask )) return CpptrajState::ERR; + if (equals.hasKey("atoms")) + value = integerToString( mask.Nselected() ); + else if (equals.hasKey("residues")) { + int curRes = -1; + int nres = 0; + for (AtomMask::const_iterator at = mask.begin(); at != mask.end(); ++at) { + int res = (*top)[*at].ResNum(); + if (res != curRes) { + nres++; + curRes = res; + } + } + value = integerToString( nres ); + } else if (equals.hasKey("molecules")) { + int curMol = -1; + int nmol = 0; + for (AtomMask::const_iterator at = mask.begin(); at != mask.end(); ++at) { + int mol = (*top)[*at].MolNum(); + if (mol != curMol) { + nmol++; + curMol = mol; + } + } + value = integerToString( nmol ); + } else { + mprinterr("Error: Expected 'atoms', 'residues', or 'molecules'.\n"); + return CpptrajState::ERR; + } + } else if (equals.hasKey("trajinframes")) { + value = integerToString(State.InputTrajList().MaxFrames()); + } else + value = equals.ArgLineStr(); + if (append) + CurrentVars.AppendVariable( "$" + variable, value ); + else + CurrentVars.UpdateVariable( "$" + variable, value ); + mprintf("\tVariable '%s' set to '%s'\n", variable.c_str(), value.c_str()); + for (int iarg = 0; iarg < argIn.Nargs(); iarg++) + argIn.MarkArg( iarg ); + return CpptrajState::OK; +} + +// ----------------------------------------------------------------------------- +void Control_Show::Help() const { + mprintf(" Show all current script variables and their values.\n"); +} + +CpptrajState::RetType + Control_Show::SetupControl(CpptrajState& State, ArgList& argIn, Varray& CurrentVars) +{ + for (Varray::const_iterator it = CurrentVars.begin(); it != CurrentVars.end(); ++it) + mprintf("\t%s = '%s'\n", it->first.c_str(), it->second.c_str()); + return CpptrajState::OK; +} diff --git a/src/Control.h b/src/Control.h new file mode 100644 index 0000000000..885678f71b --- /dev/null +++ b/src/Control.h @@ -0,0 +1,104 @@ +#ifndef INC_CONTROL_H +#define INC_CONTROL_H +#include "CpptrajState.h" +#include "VariableArray.h" +/// Control block structures. +class ControlBlock : public DispatchObject { + public: + typedef std::vector ArgArray; + typedef ArgArray::const_iterator const_iterator; + /// Hold variable/value pairs + typedef VariableArray Varray; + /// Control block states + enum DoneType { DONE = 0, NOT_DONE, ERROR }; + + ControlBlock() : DispatchObject(CONTROL) {} + virtual ~ControlBlock() {} + /// \return Description of control block. + std::string const& Description() const { return description_; } + /// Set up control block. + virtual int SetupBlock(CpptrajState&, ArgList&) = 0; + /// Check for control block end command. + virtual bool EndBlock(ArgList const&) const = 0; + /// Add command to control block. + virtual void AddCommand(ArgList const&) = 0; + /// \return iterator to first command in the block. + virtual const_iterator begin() const = 0; + /// \return iterator to last command in the block. + virtual const_iterator end() const = 0; + /// Start control block. Init internal variables if necessary. + virtual void Start() = 0; + /// Add/update variables and increment, check block state. + virtual DoneType CheckDone(Varray&) = 0; + protected: + std::string description_; ///< Describe control TODO private? +}; + +/// Loop over mask expression or integer +class ControlBlock_For : public ControlBlock { + public: + ControlBlock_For() {} + void Help() const; + DispatchObject* Alloc() const { return (DispatchObject*)new ControlBlock_For(); } + + int SetupBlock(CpptrajState&, ArgList&); + bool EndBlock(ArgList const& a) const { return (a.CommandIs("done")); } + void AddCommand(ArgList const& c) { commands_.push_back(c); } + const_iterator begin() const { return commands_.begin(); } + const_iterator end() const { return commands_.end(); } + void Start(); + DoneType CheckDone(Varray&); + private: + enum ForType {ATOMS=0, RESIDUES, MOLECULES, MOLFIRSTRES, MOLLASTRES, INTEGER, UNKNOWN}; + enum OpType { INCREMENT, DECREMENT, LESS_THAN, GREATER_THAN, NO_OP }; + typedef std::vector Iarray; + class LoopVar { + public: + LoopVar() : varType_(UNKNOWN) {} + Iarray Idxs_; ///< (MASK only) Selected atom/residue/molecule indices + Iarray::const_iterator idx_; ///< (MASK only) Current atom/residue/molecule index + std::string varname_; ///< Loop variable name + ForType varType_; ///< Loop variable type + OpType endOp_; ///< (INTEGER only) end operator + OpType incOp_; ///< (INTEGER only) increment operator + int start_; ///< (INTEGER only) initial value + int end_; ///< (INTEGER only) end value + int inc_; ///< (INTEGER only) increment value + int currentVal_; ///< (INTEGER only) current value + }; + typedef std::vector Marray; + Marray Vars_; + ArgArray commands_; +}; +// ============================================================================= +/// Work with script variables +class Control : public DispatchObject { + public: + /// Hold variable/value pairs + typedef VariableArray Varray; + + Control() : DispatchObject(CONTROL) {} + virtual ~Control() {} + virtual CpptrajState::RetType SetupControl(CpptrajState&, ArgList&, Varray&) = 0; +}; + +/// Create/update script variables +class Control_Set : public Control { + public: + Control_Set() {} + void Help() const; + DispatchObject* Alloc() const { return (DispatchObject*)new Control_Set(); } + + CpptrajState::RetType SetupControl(CpptrajState&, ArgList&, Varray&); +}; + +/// List all variables and values. +class Control_Show : public Control { + public: + Control_Show() {} + void Help() const; + DispatchObject* Alloc() const { return (DispatchObject*)new Control_Show(); } + + CpptrajState::RetType SetupControl(CpptrajState&, ArgList&, Varray&); +}; +#endif diff --git a/src/Cpptraj.cpp b/src/Cpptraj.cpp index 451e4568c8..7d61df3bad 100644 --- a/src/Cpptraj.cpp +++ b/src/Cpptraj.cpp @@ -436,6 +436,7 @@ Cpptraj::Mode Cpptraj::ProcessCmdLineArgs(int argc, char** argv) { { CpptrajState::RetType c_err = Command::ProcessInput( State_, *inputFilename ); if (c_err == CpptrajState::ERR && State_.ExitOnError()) return ERROR; + if (Command::UnterminatedControl()) return ERROR; if (c_err == CpptrajState::QUIT) return QUIT; } } @@ -450,6 +451,7 @@ Cpptraj::Mode Cpptraj::ProcessCmdLineArgs(int argc, char** argv) { // "" means read from STDIN CpptrajState::RetType c_err = Command::ProcessInput( State_, "" ); if (c_err == CpptrajState::ERR && State_.ExitOnError()) return ERROR; + if (Command::UnterminatedControl()) return ERROR; if (c_err == CpptrajState::QUIT) return QUIT; } } @@ -528,6 +530,7 @@ int Cpptraj::Interactive() { } } logfile_.CloseFile(); + if (Command::UnterminatedControl()) return 1; if (readLoop == CpptrajState::ERR) return 1; return 0; } diff --git a/src/CpptrajState.cpp b/src/CpptrajState.cpp index 2ded0222d8..6293f95e45 100644 --- a/src/CpptrajState.cpp +++ b/src/CpptrajState.cpp @@ -19,6 +19,7 @@ CpptrajState::CpptrajState() : refDebug_(0), topDebug_(0), showProgress_(true), + quietBlocks_(false), exitOnError_(true), recordAllInput_(true), noEmptyRun_(false), diff --git a/src/CpptrajState.h b/src/CpptrajState.h index 05a44e6292..a738286afe 100644 --- a/src/CpptrajState.h +++ b/src/CpptrajState.h @@ -19,6 +19,7 @@ class CpptrajState { CpptrajState(); void SetNoExitOnError() { exitOnError_ = false; } void SetNoProgress() { showProgress_ = false; } + void SetQuietBlocks(bool b) { quietBlocks_ = b; } void SetActionSilence(bool b) { actionList_.SetSilent(b); } # ifdef MPI void SetForceParaEnsemble(bool b) { forceParallelEnsemble_ = b; } @@ -30,6 +31,7 @@ class CpptrajState { TrajModeType Mode() const { return mode_; } int Debug() const { return debug_; } bool ShowProgress() const { return showProgress_;} + bool QuietBlocks() const { return quietBlocks_; } bool ExitOnError() const { return exitOnError_; } bool RecordAllInput() const { return recordAllInput_; } bool EmptyState() const { return (actionList_.Empty() && @@ -102,6 +104,7 @@ class CpptrajState { int refDebug_; ///< Reference debug level. int topDebug_; ///< Topology debug level. bool showProgress_; ///< If true, display progress during Run. + bool quietBlocks_; ///< If true suppress output when executing control blocks. bool exitOnError_; ///< If true exit when errors encountered instead of continuing. bool recordAllInput_; ///< When true save all input to log, even errors. /// If true do not process input trajectories when no actions/output trajectories. diff --git a/src/DispatchObject.cpp b/src/DispatchObject.cpp index 24ede28ef0..d800907018 100644 --- a/src/DispatchObject.cpp +++ b/src/DispatchObject.cpp @@ -11,6 +11,7 @@ const char* DispatchObject::ObjKeyword(Otype typeIn) { case ANALYSIS: return "Analysis"; case GENERAL: return "General"; case SYSTEM: return "System"; + case CONTROL: return "Control"; case HIDDEN: return 0; case DEPRECATED: return 0; } diff --git a/src/DispatchObject.h b/src/DispatchObject.h index 783c71b9ea..1719b5c6e7 100644 --- a/src/DispatchObject.h +++ b/src/DispatchObject.h @@ -9,6 +9,7 @@ class DispatchObject { public: /// Object categories. HIDDEN and DEPRECATED should always be last. enum Otype { NONE=0, GENERAL, SYSTEM, COORDS, TRAJ, PARM, ACTION, ANALYSIS, + CONTROL, HIDDEN, DEPRECATED }; /// CONSTRUCTOR DispatchObject() : type_(NONE) {} diff --git a/src/Exec_Commands.cpp b/src/Exec_Commands.cpp index 5bc17e98be..a1eaf28c6c 100644 --- a/src/Exec_Commands.cpp +++ b/src/Exec_Commands.cpp @@ -44,6 +44,17 @@ Exec::RetType Exec_NoProgress::Execute(CpptrajState& State, ArgList&) return CpptrajState::OK; } // ----------------------------------------------------------------------------- +void Exec_QuietBlocks::Help() const { + mprintf(" Suppress output when executing control blocks.\n"); +} + +Exec::RetType Exec_QuietBlocks::Execute(CpptrajState& State, ArgList&) +{ + State.SetQuietBlocks(true); + mprintf("\tSupressing output when executing control blocks.\n"); + return CpptrajState::OK; +} +// ----------------------------------------------------------------------------- void Exec_Quit::Help() const { mprintf(" Exit CPPTRAJ\n"); } // ----------------------------------------------------------------------------- void Exec_ActiveRef::Help() const { diff --git a/src/Exec_Commands.h b/src/Exec_Commands.h index fb127a4a5a..dc2cfc6c04 100644 --- a/src/Exec_Commands.h +++ b/src/Exec_Commands.h @@ -30,6 +30,16 @@ class Exec_NoProgress : public Exec { DispatchObject* Alloc() const { return (DispatchObject*)new Exec_NoProgress(); } RetType Execute(CpptrajState&, ArgList&); }; + +/// Tell CpptrajState to suppress output in control blocks +class Exec_QuietBlocks : public Exec { + public: + Exec_QuietBlocks() : Exec(GENERAL) {} + void Help() const; + DispatchObject* Alloc() const { return (DispatchObject*)new Exec_QuietBlocks(); } + RetType Execute(CpptrajState&, ArgList&); +}; + #ifdef MPI /// Tell CpptrajState to run parallel ensemble even with 1 thread/member class Exec_ForceParaEnsemble : public Exec { diff --git a/src/Parm_Amber.cpp b/src/Parm_Amber.cpp index 7f4fea2437..41bedeb3fc 100644 --- a/src/Parm_Amber.cpp +++ b/src/Parm_Amber.cpp @@ -153,6 +153,32 @@ Parm_Amber::Parm_Amber() : UB_count_[1] = 0; } +/** It seems that %Xi in sscanf() can get confused when integers take up + * the entire X characters. Not sure if this is a system bug or not, but + * this function will first ensure only 6 characters are read before + * converting to integer. + * \param ptr Input string to parse. Must not be NULL. + * \param IVALS Output integer array + * \return Number of values actually read. + */ +static inline int Get12I6(const char* ptr, int* IVALS) { + char SVALS[12][7]; + int nvals = sscanf(ptr, "%6c%6c%6c%6c%6c%6c%6c%6c%6c%6c%6c%6c", + SVALS[0], SVALS[1], SVALS[2], SVALS[3], SVALS[ 4], SVALS[ 5], + SVALS[6], SVALS[7], SVALS[8], SVALS[9], SVALS[10], SVALS[11]); + // If less than 12 values read the line was short, so the final value will be + // a newline. Ignore that. + if (nvals > 0 && nvals < 12) nvals--; + for (int i = 0; i < nvals; i++) { + // Only allow integers. Right-aligned, so check final character. + if (!isdigit(SVALS[i][5])) return 0; + SVALS[i][6] = '\0'; + //mprintf("DEBUG: %2i = %6s\n", i, SVALS[i]); + IVALS[i] = atoi( SVALS[i] ); + } + return nvals; +} + // Parm_Amber::ID_ParmFormat() bool Parm_Amber::ID_ParmFormat(CpptrajFile& fileIn) { int iamber[12]; @@ -177,10 +203,7 @@ bool Parm_Amber::ID_ParmFormat(CpptrajFile& fileIn) { int line1size = (int)strlen(lineBuf); if (line1size == (81 + fileIn.IsDos())) { fileIn.Gets(lineBuf, BUF_SIZE); - if ( sscanf(lineBuf,"%6i%6i%6i%6i%6i%6i%6i%6i%6i%6i%6i%6i", - iamber, iamber+1, iamber+2, iamber+3, - iamber+4, iamber+5, iamber+6, iamber+7, - iamber+8, iamber+9, iamber+10, iamber+11) == 12 ) + if ( Get12I6(lineBuf, iamber) == 12) { if (debug_>0) mprintf(" AMBER TOPOLOGY, OLD FORMAT\n"); ptype_ = OLDPARM; @@ -528,9 +551,7 @@ int Parm_Amber::ReadPointers(int Npointers, Topology& TopIn, FortranData const& const char* ptr = file_.NextLine(); if (ptr == 0) return 1; // Old pointers format is 12I6 - int nvals = sscanf(ptr, "%6i%6i%6i%6i%6i%6i%6i%6i%6i%6i%6i%6i", - IVALS , IVALS+1, IVALS+2, IVALS+3, IVALS+4 , IVALS+5, - IVALS+6, IVALS+7, IVALS+8, IVALS+9, IVALS+10, IVALS+11); + int nvals = Get12I6(ptr, IVALS); nPointers += nvals; // First two lines should always have 12 values. if (line < 2 && nvals < 12) { diff --git a/src/StringRoutines.cpp b/src/StringRoutines.cpp index 2f49e661a0..413fb56f4b 100644 --- a/src/StringRoutines.cpp +++ b/src/StringRoutines.cpp @@ -140,6 +140,19 @@ std::string NoTrailingWhitespace(std::string const& line) { return duplicate; } +void RemoveLeadingWhitespace(std::string& line) { + size_t pos = 0; + while (pos < line.size() && isspace(line[pos])) pos++; + if (pos > 0) + line = line.substr(pos, line.size() - pos); +} + +std::string NoLeadingWhitespace(std::string const& line) { + std::string duplicate(line); + RemoveLeadingWhitespace(duplicate); + return duplicate; +} + /// Remove all whitespace from string. void RemoveAllWhitespace(std::string& line) { if (line.empty()) return; diff --git a/src/StringRoutines.h b/src/StringRoutines.h index 06f72b9205..c58e4337f0 100644 --- a/src/StringRoutines.h +++ b/src/StringRoutines.h @@ -20,6 +20,10 @@ int FloatWidth(double); void RemoveTrailingWhitespace(std::string &); /// \return string stripped of trailing whitespace. std::string NoTrailingWhitespace(std::string const&); +/// Remove any leading whitespace from string. +void RemoveLeadingWhitespace(std::string&); +/// \return string stripped of leading whitespace. +std::string NoLeadingWhitespace(std::string const&); /// Remove all whitespace from a string void RemoveAllWhitespace(std::string&); /// \return string with all whitespace removed. diff --git a/src/VariableArray.cpp b/src/VariableArray.cpp new file mode 100644 index 0000000000..799bad4339 --- /dev/null +++ b/src/VariableArray.cpp @@ -0,0 +1,108 @@ +#include "VariableArray.h" +#include "CpptrajStdio.h" +#include "DataSet_string.h" +#include "DataSet_1D.h" +#include "StringRoutines.h" + +/** Add variable/value to array if it doesnt exist, otherwise set value. */ +void VariableArray::UpdateVariable(std::string const& varname, std::string const& value) +{ + Varray::iterator it = CurrentVars_.begin(); + for (; it != CurrentVars_.end(); ++it) + if (it->first == varname) + break; + if (it == CurrentVars_.end()) + CurrentVars_.push_back( Vpair(varname, value) ); + else + it->second = value; +} + +/** Add variable/value to array if it doesnt exist, otherwise append value. */ +void VariableArray::AppendVariable(std::string const& varname, std::string const& value) +{ + Varray::iterator it = CurrentVars_.begin(); + for (; it != CurrentVars_.end(); ++it) + if (it->first == varname) + break; + if (it == CurrentVars_.end()) + CurrentVars_.push_back( Vpair(varname, value) ); + else + it->second += value; +} + +/** Replace all variables in given ArgList with their values. */ +ArgList VariableArray::ReplaceVariables(ArgList const& argIn, DataSetList const& DSL, int debug) +{ + if (debug > 0) mprintf("DEBUG: Before variable replacement: [%s]\n", argIn.ArgLine()); + ArgList modCmd = argIn; + for (int n = 0; n < modCmd.Nargs(); n++) { + size_t pos = modCmd[n].find("$"); + while (pos != std::string::npos) { + // Argument is/contains a variable. Find first non-alphanumeric char + size_t len = 1; + for (size_t pos1 = pos+1; pos1 < modCmd[n].size(); pos1++, len++) + if (!isalnum(modCmd[n][pos1])) break; + std::string var_in_arg = modCmd[n].substr(pos, len); + // See if variable occurs in CurrentVars_ + Varray::const_iterator vp = CurrentVars_.begin(); + for (; vp != CurrentVars_.end(); ++vp) + if (vp->first == var_in_arg) break; + // If found replace with value from CurrentVars_ + if (vp != CurrentVars_.end()) { + if (debug > 0) + mprintf("DEBUG: Replaced variable '%s' with value '%s'\n", + var_in_arg.c_str(), vp->second.c_str()); + std::string arg = modCmd[n]; + arg.replace(pos, vp->first.size(), vp->second); + modCmd.ChangeArg(n, arg); + } else { + // Not found in CurrentVars_; see if this is a DataSet. + for (size_t pos1 = pos+len; pos1 < modCmd[n].size(); pos1++, len++) + if (!isalnum(modCmd[n][pos1]) && + modCmd[n][pos1] != '[' && + modCmd[n][pos1] != ':' && + modCmd[n][pos1] != ']' && + modCmd[n][pos1] != '_' && + modCmd[n][pos1] != '-' && + modCmd[n][pos1] != '%') + break; + var_in_arg = modCmd[n].substr(pos+1, len-1); + DataSet* ds = DSL.GetDataSet( var_in_arg ); + if (ds == 0) { + mprinterr("Error: Unrecognized variable in command: %s\n", var_in_arg.c_str()); + return ArgList(); + } else { + if (ds->Type() != DataSet::STRING && ds->Group() != DataSet::SCALAR_1D) { + mprinterr("Error: Only 1D data sets supported.\n"); + return ArgList(); + } + if (ds->Size() < 1) { + mprinterr("Error: Set is empty.\n"); + return ArgList(); + } + if (ds->Size() > 1) + mprintf("Warning: Only using first value.\n"); + std::string value; + if (ds->Type() == DataSet::STRING) + value = (*((DataSet_string*)ds))[0]; + else + value = doubleToString(((DataSet_1D*)ds)->Dval(0)); + if (debug > 0) + mprintf("DEBUG: Replaced variable '$%s' with value '%s' from DataSet '%s'\n", + var_in_arg.c_str(), value.c_str(), ds->legend()); + std::string arg = modCmd[n]; + arg.replace(pos, var_in_arg.size()+1, value); + modCmd.ChangeArg(n, arg); + } + } + pos = modCmd[n].find("$"); + } // END loop over this argument + } + return modCmd; +} + +void VariableArray::PrintVariables() const { + for (Varray::const_iterator vp = CurrentVars_.begin(); vp != CurrentVars_.end(); ++vp) + mprintf(" %s=%s", vp->first.c_str(), vp->second.c_str()); + mprintf("\n"); +} diff --git a/src/VariableArray.h b/src/VariableArray.h new file mode 100644 index 0000000000..51e171f4f5 --- /dev/null +++ b/src/VariableArray.h @@ -0,0 +1,28 @@ +#ifndef INC_VARIABLEARRAY_H +#define INC_VARIABLEARRAY_H +#include "DataSetList.h" +/// Hold script variables and their values. +class VariableArray { + /// Hold variable and corresponding value. + typedef std::pair Vpair; + /// Hold list of variables and corresponding values. + typedef std::vector Varray; + public: + /// CONSTRUCTOR + VariableArray() {} + /// Add/update variable with given value. + void UpdateVariable(std::string const&, std::string const&); + /// Add/append variable with given value. + void AppendVariable(std::string const&, std::string const&); + /// Replace all variables in given ArgList with their values. + ArgList ReplaceVariables(ArgList const&, DataSetList const&, int); + /// Print all variable/value pairs to stdout + void PrintVariables() const; + + typedef Varray::const_iterator const_iterator; + const_iterator begin() const { return CurrentVars_.begin(); } + const_iterator end() const { return CurrentVars_.end(); } + private: + Varray CurrentVars_; ///< Hold all current variables +}; +#endif diff --git a/src/cpptrajdepend b/src/cpptrajdepend index 8dd25a4779..d9f60829be 100644 --- a/src/cpptrajdepend +++ b/src/cpptrajdepend @@ -149,6 +149,7 @@ CmdInput.o : CmdInput.cpp CmdInput.h StringRoutines.h CmdList.o : CmdList.cpp Cmd.h CmdList.h DispatchObject.h ComplexArray.o : ComplexArray.cpp ArrayIterator.h ComplexArray.h Constraints.o : Constraints.cpp ArgList.h Atom.h AtomExtra.h AtomMask.h Box.h CharMask.h Constants.h Constraints.h CoordinateInfo.h CpptrajStdio.h FileName.h Frame.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h Parallel.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Topology.h Vec3.h +Control.o : Control.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h Control.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h StringRoutines.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h VariableArray.h Vec3.h CoordinateInfo.o : CoordinateInfo.cpp Box.h CoordinateInfo.h CpptrajStdio.h Matrix_3x3.h Parallel.h ReplicaDimArray.h Vec3.h Corr.o : Corr.cpp ArrayIterator.h ComplexArray.h Corr.h PubFFT.h CpptrajFile.o : CpptrajFile.cpp CpptrajFile.h CpptrajStdio.h FileIO.h FileIO_Bzip2.h FileIO_Gzip.h FileIO_Mpi.h FileIO_Std.h FileName.h Parallel.h StringRoutines.h @@ -214,21 +215,21 @@ EnsembleOut_Multi.o : EnsembleOut_Multi.cpp ActionFrameCounter.h ArgList.h Atom. EnsembleOut_Single.o : EnsembleOut_Single.cpp ActionFrameCounter.h ArgList.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h EnsembleOut.h EnsembleOut_Single.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Topology.h TrajectoryFile.h TrajectoryIO.h Vec3.h EnsembleOutList.o : EnsembleOutList.cpp ActionFrameCounter.h ArgList.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h EnsembleOut.h EnsembleOutList.h EnsembleOut_Multi.h EnsembleOut_Single.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Topology.h TrajectoryFile.h TrajectoryIO.h Vec3.h Ewald.o : Ewald.cpp Atom.h AtomExtra.h AtomMask.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajStdio.h Ewald.h FileName.h Frame.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h PairList.h Parallel.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Spline.h StringRoutines.h Timer.h Topology.h Vec3.h -Exec_Analyze.o : Exec_Analyze.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h Cmd.h CmdList.h Command.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h Exec.h Exec_Analyze.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h Vec3.h +Exec_Analyze.o : Exec_Analyze.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h Cmd.h CmdList.h Command.h Control.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h Exec.h Exec_Analyze.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h VariableArray.h Vec3.h Exec_Calc.o : Exec_Calc.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h Exec.h Exec_Calc.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h RPNcalc.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h Vec3.h Exec_Change.o : Exec_Change.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h Exec.h Exec_Change.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h Vec3.h Exec_ClusterMap.o : Exec_ClusterMap.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h ArrayIterator.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h ClusterMap.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_2D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_MatrixFlt.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h Exec.h Exec_ClusterMap.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h Vec3.h Exec_CombineCoords.o : Exec_CombineCoords.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h Exec.h Exec_CombineCoords.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h Vec3.h Exec_Commands.o : Exec_Commands.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h Exec.h Exec_Commands.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h Vec3.h Exec_CompareTop.o : Exec_CompareTop.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h Exec.h Exec_CompareTop.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h Vec3.h -Exec_CrdAction.o : Exec_CrdAction.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h Cmd.h CmdList.h Command.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_CRD.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h Exec.h Exec_CrdAction.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h ProgressBar.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h Vec3.h +Exec_CrdAction.o : Exec_CrdAction.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h Cmd.h CmdList.h Command.h Control.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_CRD.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h Exec.h Exec_CrdAction.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h ProgressBar.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h VariableArray.h Vec3.h Exec_CrdOut.o : Exec_CrdOut.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h Exec.h Exec_CrdOut.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h ProgressBar.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h Vec3.h Exec_CreateSet.o : Exec_CreateSet.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h Exec.h Exec_CreateSet.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h RPNcalc.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h Vec3.h Exec_DataFile.o : Exec_DataFile.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h Exec.h Exec_DataFile.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h StringRoutines.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h Vec3.h Exec_DataFilter.o : Exec_DataFilter.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Action_FilterByData.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h Array1D.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_1D.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h Exec.h Exec_DataFilter.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h ProgressBar.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h Vec3.h Exec_DataSetCmd.o : Exec_DataSetCmd.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h ArrayIterator.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h ComplexArray.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_1D.h DataSet_2D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_MatrixDbl.h DataSet_Vector.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h Exec.h Exec_DataSetCmd.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h StringRoutines.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h Vec3.h Exec_GenerateAmberRst.o : Exec_GenerateAmberRst.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h DistRoutines.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h Exec.h Exec_GenerateAmberRst.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h TextFormat.h Timer.h Topology.h TorsionRoutines.h TrajFrameCounter.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h Vec3.h -Exec_Help.o : Exec_Help.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h Cmd.h CmdList.h Command.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h Exec.h Exec_Help.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h Vec3.h +Exec_Help.o : Exec_Help.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h Cmd.h CmdList.h Command.h Control.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h Exec.h Exec_Help.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h VariableArray.h Vec3.h Exec_LoadCrd.o : Exec_LoadCrd.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h Exec.h Exec_LoadCrd.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h Trajin_Single.h TrajoutList.h Trajout_Single.h Vec3.h Exec_LoadTraj.o : Exec_LoadTraj.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_Coords_TRJ.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h Exec.h Exec_LoadTraj.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajFrameIndex.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h Vec3.h Exec_ParmBox.o : Exec_ParmBox.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h Exec.h Exec_ParmBox.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h Vec3.h @@ -239,9 +240,9 @@ Exec_PermuteDihedrals.o : Exec_PermuteDihedrals.cpp Action.h ActionFrameCounter. Exec_Precision.o : Exec_Precision.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h Exec.h Exec_Precision.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h Vec3.h Exec_PrintData.o : Exec_PrintData.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h Exec.h Exec_PrintData.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h Vec3.h Exec_ReadData.o : Exec_ReadData.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h Exec.h Exec_ReadData.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h Vec3.h -Exec_ReadInput.o : Exec_ReadInput.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h Cmd.h CmdList.h Command.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h Exec.h Exec_ReadInput.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h Vec3.h +Exec_ReadInput.o : Exec_ReadInput.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h Cmd.h CmdList.h Command.h Control.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h Exec.h Exec_ReadInput.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h VariableArray.h Vec3.h Exec_RotateDihedral.o : Exec_RotateDihedral.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h Constants.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h DihedralSearch.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h Exec.h Exec_RotateDihedral.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h TextFormat.h Timer.h Topology.h TorsionRoutines.h TrajFrameCounter.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h Vec3.h -Exec_RunAnalysis.o : Exec_RunAnalysis.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h Cmd.h CmdList.h Command.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h Exec.h Exec_RunAnalysis.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h Vec3.h +Exec_RunAnalysis.o : Exec_RunAnalysis.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h Cmd.h CmdList.h Command.h Control.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h Exec.h Exec_RunAnalysis.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h VariableArray.h Vec3.h Exec_ScaleDihedralK.o : Exec_ScaleDihedralK.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h Exec.h Exec_ScaleDihedralK.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h Vec3.h Exec_SequenceAlign.o : Exec_SequenceAlign.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h BufferedLine.h CharMask.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h Exec.h Exec_SequenceAlign.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h StringRoutines.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h Vec3.h Exec_System.o : Exec_System.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h Exec.h Exec_System.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h Vec3.h @@ -334,13 +335,14 @@ Trajin_Single.o : Trajin_Single.cpp ArgList.h Atom.h AtomExtra.h AtomMask.h Base TrajIOarray.o : TrajIOarray.cpp ArgList.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h Parallel.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h StringRoutines.h Topology.h TrajFrameCounter.h TrajIOarray.h TrajectoryFile.h TrajectoryIO.h Vec3.h Trajout_Single.o : Trajout_Single.cpp ActionFrameCounter.h ArgList.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h StringRoutines.h Topology.h TrajectoryFile.h TrajectoryIO.h Trajout_Single.h Vec3.h TrajoutList.o : TrajoutList.cpp ActionFrameCounter.h ArgList.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h Range.h ReplicaDimArray.h Residue.h Topology.h TrajectoryFile.h TrajectoryIO.h TrajoutList.h Trajout_Single.h Vec3.h +VariableArray.o : VariableArray.cpp ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h Box.h CharMask.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataSet.h DataSetList.h DataSet_1D.h DataSet_Coords.h DataSet_Coords_REF.h DataSet_string.h Dimension.h FileIO.h FileName.h Frame.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h StringRoutines.h TextFormat.h Timer.h Topology.h VariableArray.h Vec3.h Vec3.o : Vec3.cpp Constants.h CpptrajStdio.h Vec3.h ViewRst.o : ViewRst.cpp ActionFrameCounter.h ArgList.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h ParmFile.h ParmIO.h Range.h ReplicaDimArray.h Residue.h Topology.h TrajectoryFile.h TrajectoryIO.h Trajout_Single.h Vec3.h ViewRst.h Action_Esander.o : Action_Esander.cpp Action.h ActionState.h Action_Esander.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h Energy_Sander.h FileIO.h FileName.h FileTypes.h Frame.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h Residue.h TextFormat.h Timer.h Topology.h Vec3.h -Command.o : Command.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Action_Align.h Action_Angle.h Action_AreaPerMol.h Action_AtomMap.h Action_AtomicCorr.h Action_AtomicFluct.h Action_AutoImage.h Action_Average.h Action_Bounds.h Action_Box.h Action_Center.h Action_Channel.h Action_CheckChirality.h Action_CheckStructure.h Action_Closest.h Action_ClusterDihedral.h Action_Contacts.h Action_CreateCrd.h Action_CreateReservoir.h Action_DNAionTracker.h Action_DSSP.h Action_Density.h Action_Diffusion.h Action_Dihedral.h Action_Dipole.h Action_DistRmsd.h Action_Distance.h Action_Energy.h Action_Esander.h Action_FilterByData.h Action_FixAtomOrder.h Action_FixImagedBonds.h Action_GIST.h Action_Grid.h Action_GridFreeEnergy.h Action_HydrogenBond.h Action_Image.h Action_Jcoupling.h Action_LESsplit.h Action_LIE.h Action_LipidOrder.h Action_MakeStructure.h Action_Mask.h Action_Matrix.h Action_MinImage.h Action_Molsurf.h Action_MultiDihedral.h Action_MultiVector.h Action_NAstruct.h Action_NMRrst.h Action_NativeContacts.h Action_OrderParameter.h Action_Outtraj.h Action_PairDist.h Action_Pairwise.h Action_Principal.h Action_Projection.h Action_Pucker.h Action_Radgyr.h Action_Radial.h Action_RandomizeIons.h Action_Remap.h Action_ReplicateCell.h Action_Rmsd.h Action_Rotate.h Action_RunningAvg.h Action_STFC_Diffusion.h Action_Scale.h Action_SetVelocity.h Action_Spam.h Action_Strip.h Action_Surf.h Action_SymmetricRmsd.h Action_Temperature.h Action_Translate.h Action_Unstrip.h Action_Unwrap.h Action_Vector.h Action_VelocityAutoCorr.h Action_Volmap.h Action_Volume.h Action_Watershell.h Analysis.h AnalysisList.h AnalysisState.h Analysis_AmdBias.h Analysis_AutoCorr.h Analysis_Average.h Analysis_Clustering.h Analysis_Corr.h Analysis_CrankShaft.h Analysis_CrdFluct.h Analysis_CrossCorr.h Analysis_CurveFit.h Analysis_Divergence.h Analysis_FFT.h Analysis_Hist.h Analysis_IRED.h Analysis_Integrate.h Analysis_KDE.h Analysis_Lifetime.h Analysis_LowestCurve.h Analysis_Matrix.h Analysis_MeltCurve.h Analysis_Modes.h Analysis_MultiHist.h Analysis_Multicurve.h Analysis_Overlap.h Analysis_PhiPsi.h Analysis_Regression.h Analysis_RemLog.h Analysis_Rms2d.h Analysis_RmsAvgCorr.h Analysis_Rotdif.h Analysis_RunningAvg.h Analysis_Spline.h Analysis_State.h Analysis_Statistics.h Analysis_TI.h Analysis_Timecorr.h Analysis_VectorMath.h Analysis_Wavelet.h ArgList.h Array1D.h ArrayIterator.h AssociatedData.h Atom.h AtomExtra.h AtomMap.h AtomMask.h AxisType.h BaseIOtype.h Box.h BufferedLine.h CharMask.h ClusterDist.h ClusterList.h ClusterMap.h ClusterNode.h ClusterSieve.h Cmd.h CmdInput.h CmdList.h Command.h ComplexArray.h Constraints.h CoordinateInfo.h Corr.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_1D.h DataSet_2D.h DataSet_3D.h DataSet_Cmatrix.h DataSet_Coords.h DataSet_Coords_CRD.h DataSet_Coords_REF.h DataSet_GridFlt.h DataSet_Mat3x3.h DataSet_MatrixDbl.h DataSet_MatrixFlt.h DataSet_Mesh.h DataSet_Modes.h DataSet_RemLog.h DataSet_Vector.h DataSet_double.h DataSet_float.h DataSet_integer.h DataSet_string.h Deprecated.h DihedralSearch.h Dimension.h DispatchObject.h DistRoutines.h Energy.h Energy_Sander.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h Ewald.h Exec.h Exec_Analyze.h Exec_Calc.h Exec_Change.h Exec_ClusterMap.h Exec_CombineCoords.h Exec_Commands.h Exec_CompareTop.h Exec_CrdAction.h Exec_CrdOut.h Exec_CreateSet.h Exec_DataFile.h Exec_DataFilter.h Exec_DataSetCmd.h Exec_GenerateAmberRst.h Exec_Help.h Exec_LoadCrd.h Exec_LoadTraj.h Exec_ParmBox.h Exec_ParmSolvent.h Exec_ParmStrip.h Exec_ParmWrite.h Exec_PermuteDihedrals.h Exec_Precision.h Exec_PrintData.h Exec_ReadData.h Exec_ReadInput.h Exec_RotateDihedral.h Exec_RunAnalysis.h Exec_ScaleDihedralK.h Exec_SequenceAlign.h Exec_System.h Exec_Top.h Exec_Traj.h Exec_ViewRst.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h Grid.h GridAction.h GridBin.h HistBin.h Hungarian.h ImageTypes.h ImagedAction.h InputTrajCommon.h MapAtom.h MaskToken.h Matrix.h Matrix_3x3.h MetaData.h Molecule.h NameType.h NetcdfFile.h OnlineVarT.h OutputTrajCommon.h PDBfile.h PairList.h Parallel.h ParameterTypes.h PubFFT.h RPNcalc.h Random.h Range.h ReferenceAction.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Spline.h StructureCheck.h SymmetricRmsdCalc.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Traj_AmberNetcdf.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h Vec3.h molsurf.h -Cpptraj.o : Cpptraj.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h Cmd.h CmdInput.h CmdList.h Command.h CoordinateInfo.h Cpptraj.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h ParmFile.h ParmIO.h Range.h ReadLine.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h StringRoutines.h TextFormat.h Timer.h TopInfo.h Topology.h TrajFrameCounter.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h Vec3.h Version.h +Command.o : Command.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Action_Align.h Action_Angle.h Action_AreaPerMol.h Action_AtomMap.h Action_AtomicCorr.h Action_AtomicFluct.h Action_AutoImage.h Action_Average.h Action_Bounds.h Action_Box.h Action_Center.h Action_Channel.h Action_CheckChirality.h Action_CheckStructure.h Action_Closest.h Action_ClusterDihedral.h Action_Contacts.h Action_CreateCrd.h Action_CreateReservoir.h Action_DNAionTracker.h Action_DSSP.h Action_Density.h Action_Diffusion.h Action_Dihedral.h Action_Dipole.h Action_DistRmsd.h Action_Distance.h Action_Energy.h Action_Esander.h Action_FilterByData.h Action_FixAtomOrder.h Action_FixImagedBonds.h Action_GIST.h Action_Grid.h Action_GridFreeEnergy.h Action_HydrogenBond.h Action_Image.h Action_Jcoupling.h Action_LESsplit.h Action_LIE.h Action_LipidOrder.h Action_MakeStructure.h Action_Mask.h Action_Matrix.h Action_MinImage.h Action_Molsurf.h Action_MultiDihedral.h Action_MultiVector.h Action_NAstruct.h Action_NMRrst.h Action_NativeContacts.h Action_OrderParameter.h Action_Outtraj.h Action_PairDist.h Action_Pairwise.h Action_Principal.h Action_Projection.h Action_Pucker.h Action_Radgyr.h Action_Radial.h Action_RandomizeIons.h Action_Remap.h Action_ReplicateCell.h Action_Rmsd.h Action_Rotate.h Action_RunningAvg.h Action_STFC_Diffusion.h Action_Scale.h Action_SetVelocity.h Action_Spam.h Action_Strip.h Action_Surf.h Action_SymmetricRmsd.h Action_Temperature.h Action_Translate.h Action_Unstrip.h Action_Unwrap.h Action_Vector.h Action_VelocityAutoCorr.h Action_Volmap.h Action_Volume.h Action_Watershell.h Analysis.h AnalysisList.h AnalysisState.h Analysis_AmdBias.h Analysis_AutoCorr.h Analysis_Average.h Analysis_Clustering.h Analysis_Corr.h Analysis_CrankShaft.h Analysis_CrdFluct.h Analysis_CrossCorr.h Analysis_CurveFit.h Analysis_Divergence.h Analysis_FFT.h Analysis_Hist.h Analysis_IRED.h Analysis_Integrate.h Analysis_KDE.h Analysis_Lifetime.h Analysis_LowestCurve.h Analysis_Matrix.h Analysis_MeltCurve.h Analysis_Modes.h Analysis_MultiHist.h Analysis_Multicurve.h Analysis_Overlap.h Analysis_PhiPsi.h Analysis_Regression.h Analysis_RemLog.h Analysis_Rms2d.h Analysis_RmsAvgCorr.h Analysis_Rotdif.h Analysis_RunningAvg.h Analysis_Spline.h Analysis_State.h Analysis_Statistics.h Analysis_TI.h Analysis_Timecorr.h Analysis_VectorMath.h Analysis_Wavelet.h ArgList.h Array1D.h ArrayIterator.h AssociatedData.h Atom.h AtomExtra.h AtomMap.h AtomMask.h AxisType.h BaseIOtype.h Box.h BufferedLine.h CharMask.h ClusterDist.h ClusterList.h ClusterMap.h ClusterNode.h ClusterSieve.h Cmd.h CmdInput.h CmdList.h Command.h ComplexArray.h Constraints.h Control.h CoordinateInfo.h Corr.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_1D.h DataSet_2D.h DataSet_3D.h DataSet_Cmatrix.h DataSet_Coords.h DataSet_Coords_CRD.h DataSet_Coords_REF.h DataSet_GridFlt.h DataSet_Mat3x3.h DataSet_MatrixDbl.h DataSet_MatrixFlt.h DataSet_Mesh.h DataSet_Modes.h DataSet_RemLog.h DataSet_Vector.h DataSet_double.h DataSet_float.h DataSet_integer.h DataSet_string.h Deprecated.h DihedralSearch.h Dimension.h DispatchObject.h DistRoutines.h Energy.h Energy_Sander.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h Ewald.h Exec.h Exec_Analyze.h Exec_Calc.h Exec_Change.h Exec_ClusterMap.h Exec_CombineCoords.h Exec_Commands.h Exec_CompareTop.h Exec_CrdAction.h Exec_CrdOut.h Exec_CreateSet.h Exec_DataFile.h Exec_DataFilter.h Exec_DataSetCmd.h Exec_GenerateAmberRst.h Exec_Help.h Exec_LoadCrd.h Exec_LoadTraj.h Exec_ParmBox.h Exec_ParmSolvent.h Exec_ParmStrip.h Exec_ParmWrite.h Exec_PermuteDihedrals.h Exec_Precision.h Exec_PrintData.h Exec_ReadData.h Exec_ReadInput.h Exec_RotateDihedral.h Exec_RunAnalysis.h Exec_ScaleDihedralK.h Exec_SequenceAlign.h Exec_System.h Exec_Top.h Exec_Traj.h Exec_ViewRst.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h Grid.h GridAction.h GridBin.h HistBin.h Hungarian.h ImageTypes.h ImagedAction.h InputTrajCommon.h MapAtom.h MaskToken.h Matrix.h Matrix_3x3.h MetaData.h Molecule.h NameType.h NetcdfFile.h OnlineVarT.h OutputTrajCommon.h PDBfile.h PairList.h Parallel.h ParameterTypes.h PubFFT.h RPNcalc.h Random.h Range.h ReferenceAction.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h Spline.h StructureCheck.h SymmetricRmsdCalc.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h Traj_AmberNetcdf.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h VariableArray.h Vec3.h molsurf.h +Cpptraj.o : Cpptraj.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h Cmd.h CmdInput.h CmdList.h Command.h Control.h CoordinateInfo.h Cpptraj.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h ParmFile.h ParmIO.h Range.h ReadLine.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h StringRoutines.h TextFormat.h Timer.h TopInfo.h Topology.h TrajFrameCounter.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h VariableArray.h Vec3.h Version.h Energy_Sander.o : Energy_Sander.cpp ArgList.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h Energy_Sander.h FileIO.h FileName.h FileTypes.h Frame.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h Parallel.h ParameterTypes.h ParmFile.h ParmIO.h Range.h ReplicaDimArray.h Residue.h Topology.h Vec3.h -ReadLine.o : ReadLine.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h Cmd.h CmdInput.h CmdList.h Command.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h Range.h ReadLine.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h Vec3.h +ReadLine.o : ReadLine.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h Cmd.h CmdInput.h CmdList.h Command.h Control.h CoordinateInfo.h CpptrajFile.h CpptrajState.h CpptrajStdio.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h Range.h ReadLine.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h VariableArray.h Vec3.h main.o : main.cpp Action.h ActionFrameCounter.h ActionList.h ActionState.h Analysis.h AnalysisList.h AnalysisState.h ArgList.h AssociatedData.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h CharMask.h CoordinateInfo.h Cpptraj.h CpptrajFile.h CpptrajState.h DataFile.h DataFileList.h DataIO.h DataSet.h DataSetList.h DataSet_Coords.h DataSet_Coords_REF.h Dimension.h DispatchObject.h EnsembleIn.h EnsembleOut.h EnsembleOutList.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h MetaData.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h Range.h ReferenceFrame.h ReplicaDimArray.h ReplicaInfo.h Residue.h TextFormat.h Timer.h Topology.h TrajFrameCounter.h TrajectoryFile.h TrajectoryIO.h Trajin.h TrajinList.h TrajoutList.h Trajout_Single.h Vec3.h molsurf.o : molsurf.c molsurf.h AmbPDB.o : AmbPDB.cpp ActionFrameCounter.h ArgList.h Atom.h AtomExtra.h AtomMask.h BaseIOtype.h Box.h BufferedFrame.h CharMask.h CoordinateInfo.h CpptrajFile.h CpptrajStdio.h FileIO.h FileName.h FileTypes.h Frame.h FrameArray.h FramePtrArray.h InputTrajCommon.h MaskToken.h Matrix_3x3.h Molecule.h NameType.h OutputTrajCommon.h Parallel.h ParameterTypes.h ParmFile.h ParmIO.h Range.h ReplicaDimArray.h Residue.h StringRoutines.h TextFormat.h Topology.h TrajFrameCounter.h Traj_AmberRestart.h TrajectoryFile.h TrajectoryIO.h Trajin.h Trajin_Single.h Trajout_Single.h Vec3.h diff --git a/src/cpptrajfiles b/src/cpptrajfiles index 265574ba16..40e9df6b6d 100644 --- a/src/cpptrajfiles +++ b/src/cpptrajfiles @@ -151,6 +151,7 @@ COMMON_SOURCES=ActionFrameCounter.cpp \ CmdList.cpp \ ComplexArray.cpp \ Constraints.cpp \ + Control.cpp \ CoordinateInfo.cpp \ Corr.cpp \ CpptrajFile.cpp \ @@ -336,6 +337,7 @@ COMMON_SOURCES=ActionFrameCounter.cpp \ TrajIOarray.cpp \ Trajout_Single.cpp \ TrajoutList.cpp \ + VariableArray.cpp \ Vec3.cpp \ ViewRst.cpp diff --git a/test/Makefile b/test/Makefile index 75bc462826..5db7095b2e 100644 --- a/test/Makefile +++ b/test/Makefile @@ -423,6 +423,9 @@ test.scaledihedralk: test.phipsi: @-cd Test_PhiPsi && ./RunTest.sh $(OPT) +test.control: + @-cd Test_Control && ./RunTest.sh $(OPT) + # Every test target should go here. COMPLETETESTS=test.general \ test.strip \ @@ -559,7 +562,8 @@ COMPLETETESTS=test.general \ test.translate \ test.replicatecell \ test.scaledihedralk \ - test.phipsi + test.phipsi \ + test.control test.all: $(MAKE) test.complete summary diff --git a/test/Test_Control/RunTest.sh b/test/Test_Control/RunTest.sh new file mode 100755 index 0000000000..1625e653ef --- /dev/null +++ b/test/Test_Control/RunTest.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +. ../MasterTest.sh + +CleanFiles for.in TRP.vec.dat TRP.rms.dat TRP.CA.dist.dat TRP.tocenter.dat \ + nh.dat rms.nofit.dat + +TESTNAME='Loop tests' +Requires netcdf maxthreads 10 + +INPUT='-i for.in' +cat > for.in < $INPUT -N=0 -# Define N-H vectors. H atom is always N atom plus one. -for NATOM in 25 41 61 68 92 102 117 136 146 156 166 183 205 \ - 229 246 253 272 284 298 319 343 350 371 382 401 408 \ - 422 446 462 472 482 492 514 534 549 560 574 594 608 \ - 622 639 649 663 677 701 715 729 741 748 759 773 785 \ - 806 813 832 851 868 887 901 912 936 960 984 994 1008 \ - 1020 1027 1051 1079 1086 1097 1121 1135 1154 1164 1178 1211 1221 \ - 1232 1242 1261 1280 1291 1302 1314 1333 1347 1357 1368 1384 1398 \ - 1408 1418 1440 1462 1481 1497 1508 1520 1527 1541 1548 1565 1579 \ - 1589 1613 1629 1639 1663 1687 1701 1725 1735 1757 1764 1778 1790 \ - 1806 1823 1833 1857 1876 1900 1907 1917 1941 ; do - ((HATOM = NATOM + 1)) - echo "vector v$N @$NATOM ired @$HATOM" >> $INPUT - ((N++)) +cat > $INPUT <> $INPUT <