summaryrefslogtreecommitdiff
path: root/newstructure/macros/Checkdims.sci
diff options
context:
space:
mode:
authorHarpreet2016-09-03 00:36:51 +0530
committerHarpreet2016-09-03 00:36:51 +0530
commita0d9443af147e949c1e6a01ac24749d12593ec5b (patch)
tree1a1955c5482ae608fd7f618b06f4ecc6a0d39a23 /newstructure/macros/Checkdims.sci
parent4b64cf486f5c999fd8167758cae27839f3b50848 (diff)
downloadFOSSEE-Optim-toolbox-development-a0d9443af147e949c1e6a01ac24749d12593ec5b.tar.gz
FOSSEE-Optim-toolbox-development-a0d9443af147e949c1e6a01ac24749d12593ec5b.tar.bz2
FOSSEE-Optim-toolbox-development-a0d9443af147e949c1e6a01ac24749d12593ec5b.zip
cbcintlinprog added
Diffstat (limited to 'newstructure/macros/Checkdims.sci')
-rw-r--r--newstructure/macros/Checkdims.sci56
1 files changed, 0 insertions, 56 deletions
diff --git a/newstructure/macros/Checkdims.sci b/newstructure/macros/Checkdims.sci
deleted file mode 100644
index 0936222..0000000
--- a/newstructure/macros/Checkdims.sci
+++ /dev/null
@@ -1,56 +0,0 @@
-
-// Copyright (C) 2010 - DIGITEO - Michael Baudin
-//
-// This file must be used under the terms of the GNU LGPL license.
-
-function errmsg = Checkdims ( funname , var , varname , ivar , matdims )
- // Generates an error if the variable has not the required size.
- //
- // Calling Sequence
- // errmsg = Checkdims ( funname , var , varname , ivar , matdims )
- //
- // Parameters
- // funname : a 1 x 1 matrix of strings, the name of the calling function.
- // var : a 1 x 1 matrix of valid Scilab data type, the variable
- // varname : a 1 x 1 matrix of string, the name of the variable
- // ivar : a 1 x 1 matrix of floating point integers, the index of the input argument in the calling sequence
- // matdims : 1 x 2 matrix of floating point integers, the number of rows, columns for the variable #ivar
- // errmsg : a 1 x 1 matrix of strings, the error message. If there was no error, the error message is the empty matrix.
- //
- // Description
- // This function is designed to be used to design functions where
- // the input argument has a known shape.
- // This function cannot be use when var is a function, or more
- // generally, for any input argument for which the size function
- // does not work.
- // Last update : 05/08/2010.
- //
- // Examples
- // // The function takes a 2 x 3 matrix of doubles.
- // function y = myfunction ( x )
- // Checkdims ( "myfunction" , x , "x" , 1 , [2 3] )
- // y = x
- // endfunction
- // // Calling sequences which work
- // y = myfunction ( ones(2,3) )
- // y = myfunction ( zeros(2,3) )
- // // Calling sequences which generate an error
- // y = myfunction ( ones(1,3) )
- // y = myfunction ( zeros(2,4) )
- //
- // Authors
- // Michael Baudin - 2010 - DIGITEO
- //
-
- [lhs,rhs]=argn()
- Checkrhs ( funname , rhs , 5 )
- Checklhs ( funname , lhs , [0 1] )
-
- errmsg = []
- if ( or ( size(var) <> matdims ) ) then
- strexp = strcat(string(matdims)," ")
- strcomp = strcat(string(size(var))," ")
- errmsg = msprintf(gettext("%s: Expected size [%s] for input argument %s at input #%d, but got [%s] instead."), funname, strexp, varname , ivar , strcomp );
- error(errmsg)
- end
-endfunction