Пример #1
0
 /**
  * Run test to ensure matrix is complete i.e. fully populated
  *
  * @param \Chippyash\Matrix\Matrix $matrix
  *
  * @return $this
  *
  * @throws NotCompleteMatrixException
  */
 protected function assertMatrixIsComplete(Matrix $matrix)
 {
     $test = new IsComplete();
     if (!$test->is($matrix)) {
         throw new NotCompleteMatrixException($test->getErrRow());
     }
     return $this;
 }
Пример #2
0
 /**
  * Does the matrix have this attribute
  *
  * @param Matrix $mA
  * @return boolean
  */
 public function is(Matrix $mA)
 {
     //nb isComplete will return true if mA is empty
     $isComplete = new IsComplete();
     if (!$isComplete->is($mA)) {
         return false;
     }
     $m = $mA->rows();
     $n = $mA->columns();
     return $m == $n;
 }