Example #1
0
 /// <summary>
 /// Creates a  vector matrix from Zp array.
 /// </summary>
 public ZpMatrix(Zp[] vector, VectorType vec_type)
 {
     Prime = vector[0].Prime;
     if (vec_type.Equals(VectorType.Row))
     {
         RowCount = 1;
         ColCount = vector.Length;
         data     = initMatrix <long>(RowCount, ColCount);
         for (int j = 0; j < ColCount; j++)
         {
             data[0][j] = vector[j].Value;
         }
     }
     else                // VectorType.COLOMN_VECTOR
     {
         RowCount = vector.Length;
         ColCount = 1;
         data     = initMatrix <long>(RowCount, ColCount);
         for (int i = 0; i < RowCount; i++)
         {
             data[i][0] = vector[i].Value;
         }
     }
 }