Changeset c81695b in tol
- Timestamp:
- Dec 21, 2010, 6:18:34 PM (16 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 137d85f
- Parents:
- a666186
- File:
-
- 1 edited
-
tol/btol/matrix_type/matgra.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tol/btol/matrix_type/matgra.cpp
ra666186 rc81695b 6801 6801 6802 6802 6803 //--------------------------------------------------------------------6803 //-------------------------------------------------------------------- 6804 6804 DeclareContensClass(BMat, BMatTemporary, BMatMaxColByRow); 6805 6805 DefExtOpr(1, BMatMaxColByRow, "MaxColByRow", 1, 1, "Matrix", … … 6836 6836 } 6837 6837 } 6838 6838 6839 6839 6840 //-------------------------------------------------------------------- … … 6903 6904 6904 6905 //-------------------------------------------------------------------- 6906 DeclareContensClass(BMat, BMatTemporary, BMatEvalMat); 6907 DefExtOpr(1, BMatEvalMat, "EvalMat", 2, 2, "Matrix Code", 6908 "(Matrix m, Code fun)", 6909 I2("Returns a matrix with the evaluations of a given Real to Real " 6910 "function in each cell of specified matrix.\n" 6911 "Example : \n" 6912 , 6913 "Devuelve una matriz con las evaluaciones de una función dada de " 6914 "Real a Real en cada celda de la matriz especificada.\n" 6915 "Ejemplo : \n")+ 6916 "Matrix EvalMat(X, gsl_sf_log_erfc );", 6917 BOperClassify::MatrixAlgebra_); 6918 //-------------------------------------------------------------------- 6919 void BMatEvalMat::CalcContens() 6920 //-------------------------------------------------------------------- 6921 { 6922 BMat& M = Mat(Arg(1)); 6923 BCode& code = Code(Arg(2)); 6924 int k; 6925 int s = M.Data().Size(); 6926 BStandardOperator* opr = (BStandardOperator*)code.Operator(); 6927 if(!opr) 6928 { 6929 Error(I2("<fun> argument of function EvalMat has no operator", 6930 "El argumento <fun> de la función EvalMat no tiene operador")); 6931 return; 6932 } 6933 if((opr->Grammar()!= GraReal()) || 6934 (opr->NumArg()!=1)|| 6935 (opr->GrammarForArg(1)!=GraReal())) 6936 { 6937 Error(I2("<fun> argument of function EvalMat ", 6938 "El argumento <fun> de la función EvalMat ")+"\n"+ 6939 opr->Grammar()->Name()+" "+code.Name()+opr->Arguments()+"\n"+ 6940 I2("should be declared as ", 6941 "debería estar declarada como ")+"\n"+ 6942 "Real "+code.Name()+"(Real x) \n"); 6943 return; 6944 } 6945 6946 contens_.Alloc(M.Rows(), M.Columns()); 6947 const double* x = (const double*)M.Data().Buffer(); 6948 double* y = (double*)contens_.GetData().GetBuffer(); 6949 6950 BSyntaxObject* ev; 6951 for(k=0; k<s; k++, x++, y++) 6952 { 6953 BContensDat* x_ = new BContensDat("",*x); 6954 BList* args = NCons(x_); 6955 ev = opr->Evaluator(args); 6956 if(ev) 6957 { 6958 *y = Real(ev); 6959 DESTROY(ev); 6960 } 6961 } 6962 } 6963 6964 6965 //-------------------------------------------------------------------- 6905 6966 DeclareContensClass(BMat, BMatTemporary, BMatReplace); 6906 6967 DefExtOpr(1, BMatReplace, "MatReplace", 3, 3, "Matrix Matrix Matrix",
Note: See TracChangeset
for help on using the changeset viewer.
