本文整理汇总了Java中org.apache.commons.math.linear.MatrixIndexException类的典型用法代码示例。如果您正苦于以下问题:Java MatrixIndexException类的具体用法?Java MatrixIndexException怎么用?Java MatrixIndexException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MatrixIndexException类属于org.apache.commons.math.linear包,在下文中一共展示了MatrixIndexException类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import org.apache.commons.math.linear.MatrixIndexException; //导入依赖的package包/类
@BeforeClass
public static void init() throws NumberFormatException, MatrixIndexException, IOException
{
// load rating matrix:
// create a rating matrix: N_user by M_item:
BufferedReader bin = new BufferedReader(new FileReader(setTrain));
r = new OpenMapRealMatrix(userHigh + 1, itemHigh + 1);
try
{
String line = null;
while ((line = bin.readLine()) != null)
{
String elems[] = line.split(",");
int user = Integer.parseInt(elems[0]);
int item = Integer.parseInt(elems[1]);
double rating = Double.parseDouble(elems[2]);
// r.setEntry(row, column, value);
r.setEntry(user, item, rating);
}
}
finally
{
bin.close();
}
LOG.info("loaded [sparse] rating matrix: users x items = {} x {}", r.getRowDimension(), r.getColumnDimension());
}
示例2: getEntry
import org.apache.commons.math.linear.MatrixIndexException; //导入依赖的package包/类
@Override
public double getEntry(int row, int column) throws MatrixIndexException {
return vector.getElementAsDouble(Indexes.matrixIndexToVectorIndex(row, column, nrows, ncols));
}
示例3: addToEntry
import org.apache.commons.math.linear.MatrixIndexException; //导入依赖的package包/类
@Override
public void addToEntry(int row, int column, double increment)
throws MatrixIndexException {
throw new UnsupportedOperationException();
}
示例4: multiplyEntry
import org.apache.commons.math.linear.MatrixIndexException; //导入依赖的package包/类
@Override
public void multiplyEntry(int row, int column, double factor)
throws MatrixIndexException {
throw new UnsupportedOperationException();
}