Example usage for org.apache.commons.math3.linear AbstractRealMatrix getColumnDimension

List of usage examples for org.apache.commons.math3.linear AbstractRealMatrix getColumnDimension

Introduction

In this page you can find the example usage for org.apache.commons.math3.linear AbstractRealMatrix getColumnDimension.

Prototype

@Override
public abstract int getColumnDimension();

Source Link

Document

Returns the number of columns of this matrix.

Usage

From source file:com.clust4j.utils.MatUtils.java

final static public void checkDims(final AbstractRealMatrix a, final AbstractRealMatrix b) {
    checkDims(a);/*  www  .j a  v  a2 s .  c  o  m*/
    checkDims(b);

    int m1 = a.getRowDimension(), m2 = b.getRowDimension();
    int n1 = a.getColumnDimension(), n2 = b.getColumnDimension();

    if (m1 != m2)
        throw new DimensionMismatchException(m1, m2);
    if (n1 != n2)
        throw new DimensionMismatchException(n1, n2);
}