Пример #1
0
 /**
  * <summary>
  * Create a three-dimensional cell array.
  * </summary>
  * <param name="name">
  * The name of the cell array
  * </param>
  * <param name="data">
  * The three-dimensional array of IMatrix to save in the cell array.
  * </param>
  */
 public Cell(string name, IMatrix[,,] data)
 {
     this.flags = new ArrayFlags(false, ClassType.mxCELL);
     this.dims  = new ArrayDimension(data);
     this.name  = name;
     this.data  = Reshaper <IMatrix> .Transform(data);
 }
Пример #2
0
 /**
  * <summary>
  * Create a matrix containing a 3-dimensial matrix of real values.
  * <summary>
  * <param name="name">
  * name of the matrix
  * </param>
  * <param name="real">
  * 3-dimensional array containing the data for the vector
  * </param>
  */
 public Matrix(string name, double[, ,] real)
 {
     this.flags = new ArrayFlags(false, ClassType.mxDOUBLE);
     this.dims  = new ArrayDimension(real);
     this.name  = name;
     this.real  = new Element <double>(Reshaper <double> .Transform(real));
     this.imag  = null;
 }
Пример #3
0
 /**
  * <summary>
  * Create a matrix containing a 3-dimensial matrix of complex values.
  * <summary>
  * <param name="name">
  * name of the matrix
  * </param>
  * <param name="real">
  * 3-dimensional array containing the real data for the vector
  * </param>
  * <param name="imag">
  * 3-dimensional array containing the imaginary data for the vector
  * </param>
  */
 public Matrix(string name, double[, ,] real, double[, ,] imag)
 {
     if (Compatible(real, imag))
     {
         this.flags = new ArrayFlags(true, ClassType.mxDOUBLE);
         this.dims  = new ArrayDimension(real);
         this.name  = name;
         this.real  = new Element <double>(Reshaper <double> .Transform(real));
         this.imag  = new Element <double>(Reshaper <double> .Transform(imag));
     }
     else
     {
         throw new InvalidMatrixDimensionException("Real and imaginary parts of the matrix does not have the same dimensions");
     }
 }