mirror of
https://bitbucket.org/Mattrixwv/matrix.git
synced 2025-12-07 07:23:58 -05:00
Fixed addCol bug
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
//Matrix/src/main/java/com/mattrixwv/matrix/LongMatrix.java
|
||||
//Mattrixwv
|
||||
// Created: 02-10-22
|
||||
//Modified: 02-10-22
|
||||
//Modified: 02-17-22
|
||||
package com.mattrixwv.matrix;
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ public class LongMatrix{
|
||||
//Return the new grid
|
||||
return newGrid;
|
||||
}
|
||||
protected boolean isSquare(){
|
||||
public boolean isSquare(){
|
||||
if(getNumRows() == 0){
|
||||
return false;
|
||||
}
|
||||
@@ -291,7 +291,7 @@ public class LongMatrix{
|
||||
public void addCol(long[] elements){
|
||||
//Make sure the number of rows is valid
|
||||
if(grid.length == 0){
|
||||
grid = new long[1][elements.length];
|
||||
grid = new long[elements.length][1];
|
||||
}
|
||||
else if(grid.length == elements.length){
|
||||
//Copy all existing data into the new grid
|
||||
|
||||
Reference in New Issue
Block a user