ccmatrix1.cc File Reference

#include <iostream>
#include "ccmatrix.h"
#include <stdio.h>
#include <string.h>
#include "stack-c.h"

Include dependency graph for ccmatrix1.cc:

Go to the source code of this file.

Data Structures

class  SciError

Functions

int SendScilabJob (char *)
void cc_test ()

Variables

static char buf [256]


Function Documentation

void cc_test (  ) 

Definition at line 72 of file ccmatrix1.cc.

References A, and B.

Referenced by MAIN__().

00073 {
00074   CMatrix A("a","ones(2,2)");
00075   CMatrix B("b","8");
00076   A.plus(B);
00077   A.scijob("disp(%s);");
00078   A.scijob("%s=rand(2,2)");
00079   A.print();
00080   A.inv();
00081   A.print();
00082 }

Here is the caller graph for this function:

int SendScilabJob ( char *   ) 

Definition at line 17 of file SendScilabJobs.c.

Referenced by CMatrix::CMatrix(), deuxieme_exemple(), example1(), example2(), CMatrix::inv(), my_job(), my_ode_job(), my_plot(), CMatrix::plus(), premier_exemple(), CMatrix::scijob(), send_scilab_job(), and SendScilabJobs().

00018 {
00019         int retCode = -1;
00020         int lencommand=0;
00021         static char *command=NULL;
00022         
00023         char ScirunCommand[]="Err=execstr(TMP_EXEC_STRING,\"errcatch\",\"n\");quit;";
00024         char ClearTmpVariables[]="clear TMP_EXEC_STRING;clear Err;quit;";
00025         
00026         lencommand=strlen(job);
00027         command=MALLOC(sizeof(char)*(lencommand+1));
00028 
00029         if (command)
00030         {
00031                 /* clear prev. Err , TMP_EXEC_STRING scilab variables */
00032                 C2F(scirun)(ClearTmpVariables,strlen(ClearTmpVariables));
00033 
00034                 strcpy(command,job);
00035                 SetLastJob(command);
00036 
00037                 /* Creation Variable temporaire dans Scilab */
00038                 if (!C2F(cwritechain)("TMP_EXEC_STRING",&lencommand,(char*)command,(int)strlen("TMP_EXEC_STRING"),(int)strlen(command)) )
00039                 {
00040                         /* Probleme */
00041                         fprintf(stderr,"Error : SendScilabJob (1) 'TMP_EXEC_STRING'.\n");
00042                         retCode = -1;
00043 
00044                         if (command) {FREE(command);command=NULL;}
00045                         return retCode;
00046                 }
00047                 else
00048                 {
00049                         int m=0,n=0,lp=0;
00050 
00051                         C2F(scirun)(ScirunCommand,strlen(ScirunCommand));
00052 
00053                         /* get error code from scilab */
00054 
00055                         if ( ! C2F(cmatptr)("Err", &m, &n, &lp,strlen("Err")))
00056                         {
00057                                 fprintf(stderr,"Error : SendScilabJob (2) 'Err'.\n");
00058                                 retCode = -2;
00059                         }
00060                         else
00061                         {
00062                                 if (m*n == 1)
00063                                 {
00064                                         double code = -1;
00065                                         ReadMatrix("Err", &m, &n, &code);
00066                                         retCode = (int) code ;
00067                                 }
00068                                 else 
00069                                 {
00070                                         fprintf(stderr,"Error : SendScilabJob (3) 'Err'.\n");   
00071                                         retCode = -3;
00072                                 }
00073                         }
00074 
00075                         /* clear prev. Err , TMP_EXEC_STRING scilab variables */
00076                         C2F(scirun)(ClearTmpVariables,strlen(ClearTmpVariables));
00077                 }
00078                 if (command) {FREE(command);command=NULL;}
00079         }
00080         else
00081         {
00082                 fprintf(stderr,"Error : SendScilabJob (4) 'command' MALLOC.\n");
00083                 retCode = -4;
00084         }
00085 
00086         return retCode;
00087 }

Here is the caller graph for this function:


Variable Documentation

char buf[256] [static]

Definition at line 19 of file ccmatrix1.cc.

Referenced by __PARAMS(), _XawTextMBToWC(), _XawTextSearch(), bang(), bouncexy(), BuildEvent(), C2F(), changedtype(), ClassInitialize(), ClassPartInitialize(), CMatrix::CMatrix(), cmscope(), comlen(), comm_union_name(), create_argv(), createblklist(), cscope(), ctrl_key(), dataname(), DebugGW(), DebugGW1(), displaynumbers(), displaynumbersGif(), displaynumbersPos(), displaynumbersXfig(), DisplayText(), do_osc(), do_p1_charp(), do_p1_fortran(), do_string(), do_xxscanf(), DoExtension(), DoInsert(), dsort(), equiv_name(), errmsg(), Evaluate(), ExecuteCommand(), ExploreMenu(), ExposeMessageWindow(), ExposeMessageWindow1(), f__icvt(), f_inqu(), f_open(), gdImageCreateFromGif(), GetBitmapInfo(), GetCode_(), getcomp(), getenv_(), getenvc(), getpath(), getsci(), getscihome(), gettmpdir(), GetVal(), HandleToolkitErrors(), InsertNewCRs(), int_objfscanf(), intgetscicosvarsc(), intscicosimc(), CMatrix::inv(), ioseta(), key_pressed(), key_released(), Len(), lit_name(), LoadGraphMacros(), LoadMacros(), loadwave(), LWZReadByte_(), main(), mexprintf(), mexPrintf(), mixed_type(), Multiply(), mxArrayToString(), MyStrncpy(), new_arg_length(), newentry(), nextdata(), opconv_fudge(), OpenIM(), parse(), CMatrix::plus(), putpower(), readnextline(), run(), savewave(), sci_plot3d(), sci_xclick(), sci_xget(), sci_xlfont(), sci_xpoly(), sci_xset(), sci_xstringl(), sci_xtitle(), SciChMenu(), SciDelMenu(), scig_click_handler_sci(), scig_deletegwin_handler_sci(), CMatrix::scijob(), sciprint_nd(), scipvmstart(), SciSetMenu(), Search(), SelMenu(), SendGraphMacro(), SendMacro(), set_tmp_names(), setbound(), SetFunction(), SetResourceByName(), SetSci(), settmpdir(), string_num(), StripOutOldCRs(), temp_name(), to_upper(), TransposeCharacters(), trimunder(), unparseputc(), user_label(), warni(), wininfo(), WriteArgCheck(), WriteCallRest(), WriteVariableOutput(), wrt_E(), wrt_F(), and x_rsne().


Generated on Sun Mar 4 15:12:03 2007 for Scilab [trunk] by  doxygen 1.5.1