37 #if defined(__WIN32__) || defined(WIN32) 60 char myPrintfString[160];
66 sprintf( myPrintfString,
" %.16e\t", v[i] );
79 const int*
const V_idx
83 char myPrintfString[160];
89 sprintf( myPrintfString,
" %.16e\t", v[ V_idx[i] ] );
105 char myPrintfString[160];
108 sprintf( myPrintfString,
"%s = ", name );
112 return print( v, n );
124 for( i=0; i<nrow; ++i )
125 print( &(M[i*ncol]), ncol );
136 const int*
const ROW_idx,
const int*
const COL_idx
142 for( i=0; i<nrow; ++i )
143 print( &( M[ ROW_idx[i]*ncol ] ), ncol, COL_idx );
157 char myPrintfString[160];
160 sprintf( myPrintfString,
"%s = ", name );
164 return print( M, nrow, ncol );
174 char myPrintfString[160];
180 sprintf( myPrintfString,
" %d\t", index[i] );
196 char myPrintfString[160];
199 sprintf( myPrintfString,
"%s = ", name );
203 return print( index, n );
216 if ( outputfile == 0 )
219 fprintf( outputfile,
"%s", s );
231 return myPrintf(
"\nqpOASES -- An Implementation of the Online Active Set Strategy.\nCopyright (C) 2007-2008 by Hans Joachim Ferreau et al. All rights reserved.\n\nqpOASES is distributed under the terms of the \nGNU Lesser General Public License 2.1 in the hope that it will be \nuseful, but WITHOUT ANY WARRANTY; without even the implied warranty \nof MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. \nSee the GNU Lesser General Public License for more details.\n\n" );
239 const char* datafilename
247 if ( ( datafile = fopen( datafilename,
"r" ) ) == 0 )
250 sprintf( errstr,
"(%s)",datafilename );
255 for( i=0; i<nrow; ++i )
257 for( j=0; j<ncol; ++j )
259 if ( fscanf( datafile,
"%f ", &float_data ) == 0 )
263 sprintf( errstr,
"(%s)",datafilename );
266 data[i*ncol + j] = ( (
real_t) float_data );
281 const char* datafilename
293 const char* datafilename
300 if ( ( datafile = fopen( datafilename,
"r" ) ) == 0 )
303 sprintf( errstr,
"(%s)",datafilename );
310 if ( fscanf( datafile,
"%d\n", &(data[i]) ) == 0 )
314 sprintf( errstr,
"(%s)",datafilename );
340 if ( ( datafile = fopen( datafilename,
"a" ) ) == 0 )
343 sprintf( errstr,
"(%s)",datafilename );
350 if ( ( datafile = fopen( datafilename,
"w" ) ) == 0 )
353 sprintf( errstr,
"(%s)",datafilename );
359 for( i=0; i<nrow; ++i )
361 for( j=0; j<ncol; ++j )
362 fprintf( datafile,
"%.16e ", data[i*ncol+j] );
364 fprintf( datafile,
"\n" );
400 if ( ( datafile = fopen( datafilename,
"a" ) ) == 0 )
403 sprintf( errstr,
"(%s)",datafilename );
410 if ( ( datafile = fopen( datafilename,
"w" ) ) == 0 )
413 sprintf( errstr,
"(%s)",datafilename );
420 fprintf( datafile,
"%d\n", data[i] );
435 real_t current_time = -1.0;
437 #if defined(__WIN32__) || defined(WIN32) 438 LARGE_INTEGER
counter, frequency;
439 QueryPerformanceFrequency(&frequency);
440 QueryPerformanceCounter(&counter);
441 current_time = ((
real_t) counter.QuadPart) / ((
real_t) frequency.QuadPart);
443 struct timeval theclock;
444 gettimeofday( &theclock,0 );
445 current_time = 1.0*theclock.tv_sec + 1.0e-6*theclock.tv_usec;
IntermediateState sqrt(const Expression &arg)
returnValue throwError(returnValue Enumber, const char *additionaltext, const char *functionname, const char *filename, const unsigned long linenumber, VisibilityStatus localVisibilityStatus)
Allows to pass back messages to the calling function.
#define THROWERROR(retval)
real_t getNorm(const real_t *const v, int n)
returnValue readFromFile(real_t *data, int nrow, int ncol, const char *datafilename)
returnValue myPrintf(const char *s)
returnValue writeIntoFile(const real_t *const data, int nrow, int ncol, const char *datafilename, BooleanType append)
returnValue printCopyrightNotice()
myFILE * getOutputFile() const
BEGIN_NAMESPACE_QPOASES returnValue print(const real_t *const v, int n)
MessageHandling * getGlobalMessageHandler()