File tree Expand file tree Collapse file tree 1 file changed +26
-26
lines changed
Expand file tree Collapse file tree 1 file changed +26
-26
lines changed Original file line number Diff line number Diff line change @@ -227,6 +227,32 @@ public function isSquare()
227227 return $ this ->rows == $ this ->columns ;
228228 }
229229
230+ /**
231+ * isSymmetric
232+ *
233+ * @return boolean
234+ */
235+ public function isSymmetric ()
236+ {
237+ if (!$ this ->isSquare ()) {
238+ return false ;
239+ }
240+
241+ for ($ i = 0 ; $ i < $ this ->rows ; ++$ i ) {
242+ for ($ j = 0 ; $ j < $ this ->columns ; ++$ j ) {
243+ if ($ i == $ j ) {
244+ continue ;
245+ }
246+
247+ if ($ this ->get ($ i , $ j ) != $ this ->get ($ j , $ i )) {
248+ return false ;
249+ }
250+ }
251+ }
252+
253+ return true ;
254+ }
255+
230256 /**
231257 * identity
232258 *
@@ -631,30 +657,4 @@ protected function isLiteralValid(array $literal)
631657
632658 return true ;
633659 }
634-
635- /**
636- * isSymmetric
637- *
638- * @return boolean
639- */
640- protected function isSymmetric ()
641- {
642- if (!$ this ->isSquare ()) {
643- return false ;
644- }
645-
646- for ($ i = 0 ; $ i < $ this ->rows ; ++$ i ) {
647- for ($ j = 0 ; $ j < $ this ->columns ; ++$ j ) {
648- if ($ i == $ j ) {
649- continue ;
650- }
651-
652- if ($ this ->get ($ i , $ j ) != $ this ->get ($ j , $ i )) {
653- return false ;
654- }
655- }
656- }
657-
658- return true ;
659- }
660660}
You can’t perform that action at this time.
0 commit comments