Skip to content
Snippets Groups Projects
Commit 7f63973c authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

icurve/extern interface

parent 5ebbd363
No related branches found
No related tags found
No related merge requests found
......@@ -117,8 +117,8 @@ ask_again:
" - 1*int: the number of data points N\n"
" - N*double: the data points\n"
"- write to stdout a whitespace separated list of:\n"
" - N*double: the curve values\n";
// "for examples, see /usr/local/share/frida/demo-curve-c"
" - N*double: the curve values\n"
"- write to error messages to stderr\n";
goto ask_again;
} else if ( resp=="hci" ) {
cout <<
......@@ -127,8 +127,8 @@ ask_again:
" - 1*int: the number of parameters M\n"
" - M*double: the parameters\n"
"- write to stdout a whitespace separated list of:\n"
" - 1*int: the number of data pairs N\n"
" - N*2*double: a sequence of data pairs: x0 y0 x1 y1 x2 y2 ...\n";
" - N*2*double: a sequence of data pairs: x0 y0 x1 y1 x2 y2 ...\n"
"- write to error messages to stderr\n";
goto ask_again;
} else if ( resp=="c" ) {
evaMode = COlc::_SCR;
......@@ -198,10 +198,20 @@ void COlc::curve_val_vec( vector<double>* ret, const vector<double>& vt,
throw "SYSTEM ERROR cannot open " + par_fifonam;
fcntl( par_fifo, F_SETFL, O_NONBLOCK);
for( uint ip=0; ip<nPar(); ++ip ) {
string out = str( format("%i ") % nPar() );
write( par_fifo, out.c_str(), out.size() );
for ( uint ip=0; ip<nPar(); ++ip ) {
string out = str( format("%g ") % VC(j)->P[ip] );
write( par_fifo, out.c_str(), out.size() );
}
if ( evaMode==_SCR ) {
string out = str( format("%i ") % nPar() );
write( par_fifo, out.c_str(), out.size() );
for ( uint i=0; i<vt.size(); ++i ) {
string out = str( format("%g ") % vt[i] );
write( par_fifo, out.c_str(), out.size() );
}
}
close( par_fifo );
CSpec S;
......
No preview for this file type
......@@ -52,9 +52,16 @@ int main( int argc, char **argv )
// Read parameters from stdin:
// fprintf( stderr, "# test_curve_ci\n" );
scanf( "%i", &m );
if ( m!= M+1 ) {
fprintf( stderr,
"inconsistent number of parameters: %i offered, %i needed\n",
m, M+1 );
return -1;
}
scanf( "%lg", &t0 );
// fprintf( stderr, "# t0 %g\n", t0 );
for( m=0; m<M; ++m ) {
for ( m=0; m<M; ++m ) {
double val;
scanf( "%lg", &val );
P.k[m] = val>0 ? val : 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment