function [SCI2CLib, USER2CLib] = InitializeLibraryTrees(FileInfoDatFile) // ----------------------------------------------------------------- // This function initializes the SCI2C and USER library trees. // For each Scilab function a set of specialized C functions are inserted into // the corresponding tree. // For each C function a CINFO leaf is insterted into the tree. // The CINFO leaf is a structure with many fields each of them // containing information on the input and output arguments of the function. // Dim is the expression that returns the size of the output(s) // Example: // Let's consider the sin function // and a scalar input variable (I1Sz = 1) // It is possible to get the size of the output argument by using // the Dim field: Dim = "O1Sz = I1Sz" // and the following Scilab command: // eval(Dim); // // NOut is the number of the output(s). // // Input data: // FileInfoDatFile: name of the .dat file containing the FileInfo structure. // // Output data: // // Status: // 12-Apr-2007 -- Intelligente Fabio: Author. // ----------------------------------------------------------------- clear // Implement the SCI2C library tree as a tlist. SCI2CLib = tlist(["SCI2CLib"]); // Implement the USER libary tree as a tlist. USER2CLib = tlist(["USER2CLib"]); // --------------------------------------------------------------- // --- Add the elementary functions to the SCI2C library tree. --- // --------------------------------------------------------------- disp('--> Adding the elementary functions to the SCI2C library tree.'); SCI2CLib = AddElementaryFunction("sin",SCI2CLib); SCI2CLib = AddElementaryFunction("cos",SCI2CLib); // SCI2CLib = AddElementaryFunction("tan",SCI2CLib); // SCI2CLib = AddElementaryFunction("cotg",SCI2CLib); // SCI2CLib = AddElementaryFunction("asin",SCI2CLib); // SCI2CLib = AddElementaryFunction("acos",SCI2CLib); // SCI2CLib = AddElementaryFunction("sinh",SCI2CLib); // SCI2CLib = AddElementaryFunction("cosh",SCI2CLib); // SCI2CLib = AddElementaryFunction("tanh",SCI2CLib); // SCI2CLib = AddElementaryFunction("asinh",SCI2CLib); // SCI2CLib = AddElementaryFunction("acosh",SCI2CLib); // SCI2CLib = AddElementaryFunction("atanh",SCI2CLib); // SCI2CLib = AddElementaryFunction("exp",SCI2CLib); // SCI2CLib = AddElementaryFunction("log",SCI2CLib); // SCI2CLib = AddElementaryFunction("log10",SCI2CLib); // SCI2CLib = AddElementaryFunction("abs",SCI2CLib); // SCI2CLib = AddElementaryFunction("inv",SCI2CLib); // SCI2CLib = AddElementaryFunction("sqrtR",SCI2CLib); // ------------------------------------------------------------------- // --- End add the elementary functions to the SCI2C library tree. --- // ------------------------------------------------------------------- if (1==2) // determinant function [FuncStruct, CINFO, NumFunc] = AddLeafDet("det"); for ind = 1 : NumFunc, SCI2CLib = AddBranch(SCI2CLib, FuncStruct(ind), CINFO(ind) ); end // sqrt function [FuncStruct, CINFO, NumFunc] = AddLeafSqrt("sqrt"); for ind = 1 : NumFunc, SCI2CLib = AddBranch(SCI2CLib, FuncStruct(ind), CINFO(ind) ); end // I add the function with 2 Input // dot function [FuncStruct, CINFO, NumFunc] = AddLeafDotOp("DotAdd"); for ind = 1 : NumFunc, SCI2CLib = AddBranch(SCI2CLib, FuncStruct(ind), CINFO(ind) ); end [FuncStruct, CINFO, NumFunc] = AddLeafDotOp("DotSub"); for ind = 1 : NumFunc, SCI2CLib = AddBranch(SCI2CLib, FuncStruct(ind), CINFO(ind) ); end [FuncStruct, CINFO, NumFunc] = AddLeafDotOp("DotMul"); for ind = 1 : NumFunc, SCI2CLib = AddBranch(SCI2CLib, FuncStruct(ind), CINFO(ind) ); end [FuncStruct, CINFO, NumFunc] = AddLeafDotOp("DotDiv"); for ind = 1 : NumFunc, SCI2CLib = AddBranch(SCI2CLib, FuncStruct(ind), CINFO(ind) ); end // op function [FuncStruct, CINFO, NumFunc] = AddLeafDotOp("OpAdd"); for ind = 1 : NumFunc, SCI2CLib = AddBranch(SCI2CLib, FuncStruct(ind), CINFO(ind) ); end [FuncStruct, CINFO, NumFunc] = AddLeafDotOp("OpSub"); for ind = 1 : NumFunc, SCI2CLib = AddBranch(SCI2CLib, FuncStruct(ind), CINFO(ind) ); end [FuncStruct, CINFO, NumFunc] = AddLeafDotOp("OpMul"); for ind = 1 : NumFunc, SCI2CLib = AddBranch(SCI2CLib, FuncStruct(ind), CINFO(ind) ); end [FuncStruct, CINFO, NumFunc] = AddLeafDotOp("OpDiv"); for ind = 1 : NumFunc, SCI2CLib = AddBranch(SCI2CLib, FuncStruct(ind), CINFO(ind) ); end // atan function [FuncStruct, CINFO, NumFunc] = AddLeafAtan("atan"); for ind = 1 : NumFunc, SCI2CLib = AddBranch(SCI2CLib, FuncStruct(ind), CINFO(ind) ); end // convol function [FuncStruct, CINFO, NumFunc] = AddLeafConvol("convol"); for ind = 1 : NumFunc, SCI2CLib = AddBranch(SCI2CLib, FuncStruct(ind), CINFO(ind) ); end // fft function [FuncStruct, CINFO, NumFunc] = AddLeafFFT("fft"); for ind = 1 : NumFunc, SCI2CLib = AddBranch(SCI2CLib, FuncStruct(ind), CINFO(ind) ); end // ifft function [FuncStruct, CINFO, NumFunc] = AddLeafIFFT("ifft"); for ind = 1 : NumFunc, SCI2CLib = AddBranch(SCI2CLib, FuncStruct(ind), CINFO(ind) ); end end // end if (1==2) endfunction