id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
162,300 | bluelinelabs/LoganSquare | core/src/main/java/com/bluelinelabs/logansquare/LoganSquare.java | LoganSquare.parse | public static <E> E parse(InputStream is, ParameterizedType<E> jsonObjectType) throws IOException {
return mapperFor(jsonObjectType).parse(is);
} | java | public static <E> E parse(InputStream is, ParameterizedType<E> jsonObjectType) throws IOException {
return mapperFor(jsonObjectType).parse(is);
} | [
"public",
"static",
"<",
"E",
">",
"E",
"parse",
"(",
"InputStream",
"is",
",",
"ParameterizedType",
"<",
"E",
">",
"jsonObjectType",
")",
"throws",
"IOException",
"{",
"return",
"mapperFor",
"(",
"jsonObjectType",
")",
".",
"parse",
"(",
"is",
")",
";",
... | Parse a parameterized object from an InputStream.
@param is The InputStream, most likely from your networking library.
@param jsonObjectType The ParameterizedType describing the object. Ex: LoganSquare.parse(is, new ParameterizedType<MyModel<OtherModel>>() { }); | [
"Parse",
"a",
"parameterized",
"object",
"from",
"an",
"InputStream",
"."
] | 6c5ec5281fb58d85a99413b7b6f55e9ef18a6e06 | https://github.com/bluelinelabs/LoganSquare/blob/6c5ec5281fb58d85a99413b7b6f55e9ef18a6e06/core/src/main/java/com/bluelinelabs/logansquare/LoganSquare.java#L88-L90 |
162,301 | bluelinelabs/LoganSquare | core/src/main/java/com/bluelinelabs/logansquare/LoganSquare.java | LoganSquare.serialize | @SuppressWarnings("unchecked")
public static <E> String serialize(E object, ParameterizedType<E> parameterizedType) throws IOException {
return mapperFor(parameterizedType).serialize(object);
} | java | @SuppressWarnings("unchecked")
public static <E> String serialize(E object, ParameterizedType<E> parameterizedType) throws IOException {
return mapperFor(parameterizedType).serialize(object);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"E",
">",
"String",
"serialize",
"(",
"E",
"object",
",",
"ParameterizedType",
"<",
"E",
">",
"parameterizedType",
")",
"throws",
"IOException",
"{",
"return",
"mapperFor",
"(",
"para... | Serialize a parameterized object to a JSON String.
@param object The object to serialize.
@param parameterizedType The ParameterizedType describing the object. Ex: LoganSquare.serialize(object, new ParameterizedType<MyModel<OtherModel>>() { }); | [
"Serialize",
"a",
"parameterized",
"object",
"to",
"a",
"JSON",
"String",
"."
] | 6c5ec5281fb58d85a99413b7b6f55e9ef18a6e06 | https://github.com/bluelinelabs/LoganSquare/blob/6c5ec5281fb58d85a99413b7b6f55e9ef18a6e06/core/src/main/java/com/bluelinelabs/logansquare/LoganSquare.java#L169-L172 |
162,302 | bluelinelabs/LoganSquare | core/src/main/java/com/bluelinelabs/logansquare/LoganSquare.java | LoganSquare.serialize | @SuppressWarnings("unchecked")
public static <E> void serialize(E object, ParameterizedType<E> parameterizedType, OutputStream os) throws IOException {
mapperFor(parameterizedType).serialize(object, os);
} | java | @SuppressWarnings("unchecked")
public static <E> void serialize(E object, ParameterizedType<E> parameterizedType, OutputStream os) throws IOException {
mapperFor(parameterizedType).serialize(object, os);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"E",
">",
"void",
"serialize",
"(",
"E",
"object",
",",
"ParameterizedType",
"<",
"E",
">",
"parameterizedType",
",",
"OutputStream",
"os",
")",
"throws",
"IOException",
"{",
"mapperF... | Serialize a parameterized object to an OutputStream.
@param object The object to serialize.
@param parameterizedType The ParameterizedType describing the object. Ex: LoganSquare.serialize(object, new ParameterizedType<MyModel<OtherModel>>() { }, os);
@param os The OutputStream being written to. | [
"Serialize",
"a",
"parameterized",
"object",
"to",
"an",
"OutputStream",
"."
] | 6c5ec5281fb58d85a99413b7b6f55e9ef18a6e06 | https://github.com/bluelinelabs/LoganSquare/blob/6c5ec5281fb58d85a99413b7b6f55e9ef18a6e06/core/src/main/java/com/bluelinelabs/logansquare/LoganSquare.java#L181-L184 |
162,303 | bluelinelabs/LoganSquare | core/src/main/java/com/bluelinelabs/logansquare/LoganSquare.java | LoganSquare.serialize | public static <E> String serialize(Map<String, E> map, Class<E> jsonObjectClass) throws IOException {
return mapperFor(jsonObjectClass).serialize(map);
} | java | public static <E> String serialize(Map<String, E> map, Class<E> jsonObjectClass) throws IOException {
return mapperFor(jsonObjectClass).serialize(map);
} | [
"public",
"static",
"<",
"E",
">",
"String",
"serialize",
"(",
"Map",
"<",
"String",
",",
"E",
">",
"map",
",",
"Class",
"<",
"E",
">",
"jsonObjectClass",
")",
"throws",
"IOException",
"{",
"return",
"mapperFor",
"(",
"jsonObjectClass",
")",
".",
"serial... | Serialize a map of objects to a JSON String.
@param map The map of objects to serialize.
@param jsonObjectClass The @JsonObject class of the list elements | [
"Serialize",
"a",
"map",
"of",
"objects",
"to",
"a",
"JSON",
"String",
"."
] | 6c5ec5281fb58d85a99413b7b6f55e9ef18a6e06 | https://github.com/bluelinelabs/LoganSquare/blob/6c5ec5281fb58d85a99413b7b6f55e9ef18a6e06/core/src/main/java/com/bluelinelabs/logansquare/LoganSquare.java#L213-L215 |
162,304 | bluelinelabs/LoganSquare | core/src/main/java/com/bluelinelabs/logansquare/LoganSquare.java | LoganSquare.typeConverterFor | @SuppressWarnings("unchecked")
public static <E> TypeConverter<E> typeConverterFor(Class<E> cls) throws NoSuchTypeConverterException {
TypeConverter<E> typeConverter = TYPE_CONVERTERS.get(cls);
if (typeConverter == null) {
throw new NoSuchTypeConverterException(cls);
}
re... | java | @SuppressWarnings("unchecked")
public static <E> TypeConverter<E> typeConverterFor(Class<E> cls) throws NoSuchTypeConverterException {
TypeConverter<E> typeConverter = TYPE_CONVERTERS.get(cls);
if (typeConverter == null) {
throw new NoSuchTypeConverterException(cls);
}
re... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"E",
">",
"TypeConverter",
"<",
"E",
">",
"typeConverterFor",
"(",
"Class",
"<",
"E",
">",
"cls",
")",
"throws",
"NoSuchTypeConverterException",
"{",
"TypeConverter",
"<",
"E",
">",
... | Returns a TypeConverter for a given class.
@param cls The class for which the TypeConverter should be fetched. | [
"Returns",
"a",
"TypeConverter",
"for",
"a",
"given",
"class",
"."
] | 6c5ec5281fb58d85a99413b7b6f55e9ef18a6e06 | https://github.com/bluelinelabs/LoganSquare/blob/6c5ec5281fb58d85a99413b7b6f55e9ef18a6e06/core/src/main/java/com/bluelinelabs/logansquare/LoganSquare.java#L334-L341 |
162,305 | bluelinelabs/LoganSquare | core/src/main/java/com/bluelinelabs/logansquare/LoganSquare.java | LoganSquare.registerTypeConverter | public static <E> void registerTypeConverter(Class<E> cls, TypeConverter<E> converter) {
TYPE_CONVERTERS.put(cls, converter);
} | java | public static <E> void registerTypeConverter(Class<E> cls, TypeConverter<E> converter) {
TYPE_CONVERTERS.put(cls, converter);
} | [
"public",
"static",
"<",
"E",
">",
"void",
"registerTypeConverter",
"(",
"Class",
"<",
"E",
">",
"cls",
",",
"TypeConverter",
"<",
"E",
">",
"converter",
")",
"{",
"TYPE_CONVERTERS",
".",
"put",
"(",
"cls",
",",
"converter",
")",
";",
"}"
] | Register a new TypeConverter for parsing and serialization.
@param cls The class for which the TypeConverter should be used.
@param converter The TypeConverter | [
"Register",
"a",
"new",
"TypeConverter",
"for",
"parsing",
"and",
"serialization",
"."
] | 6c5ec5281fb58d85a99413b7b6f55e9ef18a6e06 | https://github.com/bluelinelabs/LoganSquare/blob/6c5ec5281fb58d85a99413b7b6f55e9ef18a6e06/core/src/main/java/com/bluelinelabs/logansquare/LoganSquare.java#L349-L351 |
162,306 | bluelinelabs/LoganSquare | core/src/main/java/com/bluelinelabs/logansquare/util/SimpleArrayMap.java | SimpleArrayMap.indexOfKey | public int indexOfKey(Object key) {
return key == null ? indexOfNull() : indexOf(key, key.hashCode());
} | java | public int indexOfKey(Object key) {
return key == null ? indexOfNull() : indexOf(key, key.hashCode());
} | [
"public",
"int",
"indexOfKey",
"(",
"Object",
"key",
")",
"{",
"return",
"key",
"==",
"null",
"?",
"indexOfNull",
"(",
")",
":",
"indexOf",
"(",
"key",
",",
"key",
".",
"hashCode",
"(",
")",
")",
";",
"}"
] | Returns the index of a key in the set.
@param key The key to search for.
@return Returns the index of the key if it exists, else a negative integer. | [
"Returns",
"the",
"index",
"of",
"a",
"key",
"in",
"the",
"set",
"."
] | 6c5ec5281fb58d85a99413b7b6f55e9ef18a6e06 | https://github.com/bluelinelabs/LoganSquare/blob/6c5ec5281fb58d85a99413b7b6f55e9ef18a6e06/core/src/main/java/com/bluelinelabs/logansquare/util/SimpleArrayMap.java#L273-L275 |
162,307 | bluelinelabs/LoganSquare | core/src/main/java/com/bluelinelabs/logansquare/util/SimpleArrayMap.java | SimpleArrayMap.put | public V put(K key, V value) {
final int hash;
int index;
if (key == null) {
hash = 0;
index = indexOfNull();
} else {
hash = key.hashCode();
index = indexOf(key, hash);
}
if (index >= 0) {
index = (index<<1) + 1... | java | public V put(K key, V value) {
final int hash;
int index;
if (key == null) {
hash = 0;
index = indexOfNull();
} else {
hash = key.hashCode();
index = indexOf(key, hash);
}
if (index >= 0) {
index = (index<<1) + 1... | [
"public",
"V",
"put",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"final",
"int",
"hash",
";",
"int",
"index",
";",
"if",
"(",
"key",
"==",
"null",
")",
"{",
"hash",
"=",
"0",
";",
"index",
"=",
"indexOfNull",
"(",
")",
";",
"}",
"else",
"{... | Add a new value to the array map.
@param key The key under which to store the value. <b>Must not be null.</b> If
this key already exists in the array, its value will be replaced.
@param value The value to store for the given key.
@return Returns the old value that was stored for the given key, or null if there
was no... | [
"Add",
"a",
"new",
"value",
"to",
"the",
"array",
"map",
"."
] | 6c5ec5281fb58d85a99413b7b6f55e9ef18a6e06 | https://github.com/bluelinelabs/LoganSquare/blob/6c5ec5281fb58d85a99413b7b6f55e9ef18a6e06/core/src/main/java/com/bluelinelabs/logansquare/util/SimpleArrayMap.java#L364-L408 |
162,308 | edvin/fxlauncher | src/main/java/fxlauncher/LauncherParams.java | LauncherParams.computeUnnamedParams | private void computeUnnamedParams() {
unnamedParams.addAll(rawArgs.stream().filter(arg -> !isNamedParam(arg)).collect(Collectors.toList()));
} | java | private void computeUnnamedParams() {
unnamedParams.addAll(rawArgs.stream().filter(arg -> !isNamedParam(arg)).collect(Collectors.toList()));
} | [
"private",
"void",
"computeUnnamedParams",
"(",
")",
"{",
"unnamedParams",
".",
"addAll",
"(",
"rawArgs",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"arg",
"->",
"!",
"isNamedParam",
"(",
"arg",
")",
")",
".",
"collect",
"(",
"Collectors",
".",
"toList... | This method computes the list of unnamed parameters, by filtering the
list of raw arguments, stripping out the named parameters. | [
"This",
"method",
"computes",
"the",
"list",
"of",
"unnamed",
"parameters",
"by",
"filtering",
"the",
"list",
"of",
"raw",
"arguments",
"stripping",
"out",
"the",
"named",
"parameters",
"."
] | 3024b413c8743d1e3576e91f9911b68076bcb625 | https://github.com/edvin/fxlauncher/blob/3024b413c8743d1e3576e91f9911b68076bcb625/src/main/java/fxlauncher/LauncherParams.java#L97-L99 |
162,309 | lessthanoptimal/ejml | examples/src/org/ejml/example/StatisticsMatrix.java | StatisticsMatrix.wrap | public static StatisticsMatrix wrap( DMatrixRMaj m ) {
StatisticsMatrix ret = new StatisticsMatrix();
ret.setMatrix( m );
return ret;
} | java | public static StatisticsMatrix wrap( DMatrixRMaj m ) {
StatisticsMatrix ret = new StatisticsMatrix();
ret.setMatrix( m );
return ret;
} | [
"public",
"static",
"StatisticsMatrix",
"wrap",
"(",
"DMatrixRMaj",
"m",
")",
"{",
"StatisticsMatrix",
"ret",
"=",
"new",
"StatisticsMatrix",
"(",
")",
";",
"ret",
".",
"setMatrix",
"(",
"m",
")",
";",
"return",
"ret",
";",
"}"
] | Wraps a StatisticsMatrix around 'm'. Does NOT create a copy of 'm' but saves a reference
to it. | [
"Wraps",
"a",
"StatisticsMatrix",
"around",
"m",
".",
"Does",
"NOT",
"create",
"a",
"copy",
"of",
"m",
"but",
"saves",
"a",
"reference",
"to",
"it",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/examples/src/org/ejml/example/StatisticsMatrix.java#L50-L55 |
162,310 | lessthanoptimal/ejml | examples/src/org/ejml/example/StatisticsMatrix.java | StatisticsMatrix.mean | public double mean() {
double total = 0;
final int N = getNumElements();
for( int i = 0; i < N; i++ ) {
total += get(i);
}
return total/N;
} | java | public double mean() {
double total = 0;
final int N = getNumElements();
for( int i = 0; i < N; i++ ) {
total += get(i);
}
return total/N;
} | [
"public",
"double",
"mean",
"(",
")",
"{",
"double",
"total",
"=",
"0",
";",
"final",
"int",
"N",
"=",
"getNumElements",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"N",
";",
"i",
"++",
")",
"{",
"total",
"+=",
"get",
"(",... | Computes the mean or average of all the elements.
@return mean | [
"Computes",
"the",
"mean",
"or",
"average",
"of",
"all",
"the",
"elements",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/examples/src/org/ejml/example/StatisticsMatrix.java#L62-L71 |
162,311 | lessthanoptimal/ejml | examples/src/org/ejml/example/StatisticsMatrix.java | StatisticsMatrix.stdev | public double stdev() {
double m = mean();
double total = 0;
final int N = getNumElements();
if( N <= 1 )
throw new IllegalArgumentException("There must be more than one element to compute stdev");
for( int i = 0; i < N; i++ ) {
double x = get(i);
... | java | public double stdev() {
double m = mean();
double total = 0;
final int N = getNumElements();
if( N <= 1 )
throw new IllegalArgumentException("There must be more than one element to compute stdev");
for( int i = 0; i < N; i++ ) {
double x = get(i);
... | [
"public",
"double",
"stdev",
"(",
")",
"{",
"double",
"m",
"=",
"mean",
"(",
")",
";",
"double",
"total",
"=",
"0",
";",
"final",
"int",
"N",
"=",
"getNumElements",
"(",
")",
";",
"if",
"(",
"N",
"<=",
"1",
")",
"throw",
"new",
"IllegalArgumentExce... | Computes the unbiased standard deviation of all the elements.
@return standard deviation | [
"Computes",
"the",
"unbiased",
"standard",
"deviation",
"of",
"all",
"the",
"elements",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/examples/src/org/ejml/example/StatisticsMatrix.java#L78-L97 |
162,312 | lessthanoptimal/ejml | examples/src/org/ejml/example/StatisticsMatrix.java | StatisticsMatrix.createMatrix | @Override
protected StatisticsMatrix createMatrix(int numRows, int numCols, MatrixType type) {
return new StatisticsMatrix(numRows,numCols);
} | java | @Override
protected StatisticsMatrix createMatrix(int numRows, int numCols, MatrixType type) {
return new StatisticsMatrix(numRows,numCols);
} | [
"@",
"Override",
"protected",
"StatisticsMatrix",
"createMatrix",
"(",
"int",
"numRows",
",",
"int",
"numCols",
",",
"MatrixType",
"type",
")",
"{",
"return",
"new",
"StatisticsMatrix",
"(",
"numRows",
",",
"numCols",
")",
";",
"}"
] | Returns a matrix of StatisticsMatrix type so that SimpleMatrix functions create matrices
of the correct type. | [
"Returns",
"a",
"matrix",
"of",
"StatisticsMatrix",
"type",
"so",
"that",
"SimpleMatrix",
"functions",
"create",
"matrices",
"of",
"the",
"correct",
"type",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/examples/src/org/ejml/example/StatisticsMatrix.java#L103-L106 |
162,313 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/block/decomposition/chol/CholeskyOuterForm_DDRB.java | CholeskyOuterForm_DDRB.decompose | @Override
public boolean decompose(DMatrixRBlock A) {
if( A.numCols != A.numRows )
throw new IllegalArgumentException("A must be square");
this.T = A;
if( lower )
return decomposeLower();
else
return decomposeUpper();
} | java | @Override
public boolean decompose(DMatrixRBlock A) {
if( A.numCols != A.numRows )
throw new IllegalArgumentException("A must be square");
this.T = A;
if( lower )
return decomposeLower();
else
return decomposeUpper();
} | [
"@",
"Override",
"public",
"boolean",
"decompose",
"(",
"DMatrixRBlock",
"A",
")",
"{",
"if",
"(",
"A",
".",
"numCols",
"!=",
"A",
".",
"numRows",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"A must be square\"",
")",
";",
"this",
".",
"T",
"="... | Decomposes the provided matrix and stores the result in the same matrix.
@param A Matrix that is to be decomposed. Modified.
@return If it succeeded or not. | [
"Decomposes",
"the",
"provided",
"matrix",
"and",
"stores",
"the",
"result",
"in",
"the",
"same",
"matrix",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/block/decomposition/chol/CholeskyOuterForm_DDRB.java#L71-L82 |
162,314 | lessthanoptimal/ejml | main/ejml-core/src/org/ejml/ops/MatrixIO.java | MatrixIO.saveBin | public static void saveBin(DMatrix A, String fileName)
throws IOException
{
FileOutputStream fileStream = new FileOutputStream(fileName);
ObjectOutputStream stream = new ObjectOutputStream(fileStream);
try {
stream.writeObject(A);
stream.flush();
} fi... | java | public static void saveBin(DMatrix A, String fileName)
throws IOException
{
FileOutputStream fileStream = new FileOutputStream(fileName);
ObjectOutputStream stream = new ObjectOutputStream(fileStream);
try {
stream.writeObject(A);
stream.flush();
} fi... | [
"public",
"static",
"void",
"saveBin",
"(",
"DMatrix",
"A",
",",
"String",
"fileName",
")",
"throws",
"IOException",
"{",
"FileOutputStream",
"fileStream",
"=",
"new",
"FileOutputStream",
"(",
"fileName",
")",
";",
"ObjectOutputStream",
"stream",
"=",
"new",
"Ob... | Saves a matrix to disk using Java binary serialization.
@param A The matrix being saved.
@param fileName Name of the file its being saved at.
@throws java.io.IOException | [
"Saves",
"a",
"matrix",
"to",
"disk",
"using",
"Java",
"binary",
"serialization",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-core/src/org/ejml/ops/MatrixIO.java#L48-L66 |
162,315 | lessthanoptimal/ejml | main/ejml-dsparse/src/org/ejml/sparse/csc/RandomMatrices_DSCC.java | RandomMatrices_DSCC.rectangle | public static DMatrixSparseCSC rectangle(int numRows , int numCols , int nz_total ,
double min , double max , Random rand ) {
nz_total = Math.min(numCols*numRows,nz_total);
int[] selected = UtilEjml.shuffled(numRows*numCols, nz_total, rand);
Arrays.s... | java | public static DMatrixSparseCSC rectangle(int numRows , int numCols , int nz_total ,
double min , double max , Random rand ) {
nz_total = Math.min(numCols*numRows,nz_total);
int[] selected = UtilEjml.shuffled(numRows*numCols, nz_total, rand);
Arrays.s... | [
"public",
"static",
"DMatrixSparseCSC",
"rectangle",
"(",
"int",
"numRows",
",",
"int",
"numCols",
",",
"int",
"nz_total",
",",
"double",
"min",
",",
"double",
"max",
",",
"Random",
"rand",
")",
"{",
"nz_total",
"=",
"Math",
".",
"min",
"(",
"numCols",
"... | Randomly generates matrix with the specified number of non-zero elements filled with values from min to max.
@param numRows Number of rows
@param numCols Number of columns
@param nz_total Total number of non-zero elements in the matrix
@param min Minimum element value, inclusive
@param max Maximum element value, inclu... | [
"Randomly",
"generates",
"matrix",
"with",
"the",
"specified",
"number",
"of",
"non",
"-",
"zero",
"elements",
"filled",
"with",
"values",
"from",
"min",
"to",
"max",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-dsparse/src/org/ejml/sparse/csc/RandomMatrices_DSCC.java#L46-L73 |
162,316 | lessthanoptimal/ejml | main/ejml-dsparse/src/org/ejml/sparse/csc/RandomMatrices_DSCC.java | RandomMatrices_DSCC.symmetric | public static DMatrixSparseCSC symmetric( int N , int nz_total ,
double min , double max , Random rand) {
// compute the number of elements in the triangle, including diagonal
int Ntriagle = (N*N+N)/2;
// create a list of open elements
int o... | java | public static DMatrixSparseCSC symmetric( int N , int nz_total ,
double min , double max , Random rand) {
// compute the number of elements in the triangle, including diagonal
int Ntriagle = (N*N+N)/2;
// create a list of open elements
int o... | [
"public",
"static",
"DMatrixSparseCSC",
"symmetric",
"(",
"int",
"N",
",",
"int",
"nz_total",
",",
"double",
"min",
",",
"double",
"max",
",",
"Random",
"rand",
")",
"{",
"// compute the number of elements in the triangle, including diagonal",
"int",
"Ntriagle",
"=",
... | Creates a random symmetric matrix. The entire matrix will be filled in, not just a triangular
portion.
@param N Number of rows and columns
@param nz_total Number of nonzero elements in the triangular portion of the matrix
@param min Minimum element value, inclusive
@param max Maximum element value, inclusive
@param ra... | [
"Creates",
"a",
"random",
"symmetric",
"matrix",
".",
"The",
"entire",
"matrix",
"will",
"be",
"filled",
"in",
"not",
"just",
"a",
"triangular",
"portion",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-dsparse/src/org/ejml/sparse/csc/RandomMatrices_DSCC.java#L91-L129 |
162,317 | lessthanoptimal/ejml | main/ejml-dsparse/src/org/ejml/sparse/csc/RandomMatrices_DSCC.java | RandomMatrices_DSCC.triangle | public static DMatrixSparseCSC triangle( boolean upper , int N , double minFill , double maxFill , Random rand ) {
int nz = (int)(((N-1)*(N-1)/2)*(rand.nextDouble()*(maxFill-minFill)+minFill))+N;
if( upper ) {
return triangleUpper(N,0,nz,-1,1,rand);
} else {
return trian... | java | public static DMatrixSparseCSC triangle( boolean upper , int N , double minFill , double maxFill , Random rand ) {
int nz = (int)(((N-1)*(N-1)/2)*(rand.nextDouble()*(maxFill-minFill)+minFill))+N;
if( upper ) {
return triangleUpper(N,0,nz,-1,1,rand);
} else {
return trian... | [
"public",
"static",
"DMatrixSparseCSC",
"triangle",
"(",
"boolean",
"upper",
",",
"int",
"N",
",",
"double",
"minFill",
",",
"double",
"maxFill",
",",
"Random",
"rand",
")",
"{",
"int",
"nz",
"=",
"(",
"int",
")",
"(",
"(",
"(",
"N",
"-",
"1",
")",
... | Creates a triangular matrix where the amount of fill is randomly selected too.
@param upper true for upper triangular and false for lower
@param N number of rows and columns
er * @param minFill minimum fill fraction
@param maxFill maximum fill fraction
@param rand random number generator
@return Random matrix | [
"Creates",
"a",
"triangular",
"matrix",
"where",
"the",
"amount",
"of",
"fill",
"is",
"randomly",
"selected",
"too",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-dsparse/src/org/ejml/sparse/csc/RandomMatrices_DSCC.java#L236-L244 |
162,318 | lessthanoptimal/ejml | main/ejml-dsparse/src/org/ejml/sparse/csc/RandomMatrices_DSCC.java | RandomMatrices_DSCC.ensureNotSingular | public static void ensureNotSingular( DMatrixSparseCSC A , Random rand ) {
// if( A.numRows < A.numCols ) {
// throw new IllegalArgumentException("Fewer equations than variables");
// }
int []s = UtilEjml.shuffled(A.numRows,rand);
Arrays.sort(s);
int N = Math.min(A.num... | java | public static void ensureNotSingular( DMatrixSparseCSC A , Random rand ) {
// if( A.numRows < A.numCols ) {
// throw new IllegalArgumentException("Fewer equations than variables");
// }
int []s = UtilEjml.shuffled(A.numRows,rand);
Arrays.sort(s);
int N = Math.min(A.num... | [
"public",
"static",
"void",
"ensureNotSingular",
"(",
"DMatrixSparseCSC",
"A",
",",
"Random",
"rand",
")",
"{",
"// if( A.numRows < A.numCols ) {",
"// throw new IllegalArgumentException(\"Fewer equations than variables\");",
"// }",
"int",
"[",
"]",
"s",... | Modies the matrix to make sure that at least one element in each column has a value | [
"Modies",
"the",
"matrix",
"to",
"make",
"sure",
"that",
"at",
"least",
"one",
"element",
"in",
"each",
"column",
"has",
"a",
"value"
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-dsparse/src/org/ejml/sparse/csc/RandomMatrices_DSCC.java#L271-L283 |
162,319 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/misc/DeterminantFromMinor_DDRM.java | DeterminantFromMinor_DDRM.compute | public double compute( DMatrix1Row mat ) {
if( width != mat.numCols || width != mat.numRows ) {
throw new RuntimeException("Unexpected matrix dimension");
}
// make sure everything is in the proper state before it starts
initStructures();
// System.arraycopy(mat.data... | java | public double compute( DMatrix1Row mat ) {
if( width != mat.numCols || width != mat.numRows ) {
throw new RuntimeException("Unexpected matrix dimension");
}
// make sure everything is in the proper state before it starts
initStructures();
// System.arraycopy(mat.data... | [
"public",
"double",
"compute",
"(",
"DMatrix1Row",
"mat",
")",
"{",
"if",
"(",
"width",
"!=",
"mat",
".",
"numCols",
"||",
"width",
"!=",
"mat",
".",
"numRows",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Unexpected matrix dimension\"",
")",
";",
... | Computes the determinant for the specified matrix. It must be square and have
the same width and height as what was specified in the constructor.
@param mat The matrix whose determinant is to be computed.
@return The determinant. | [
"Computes",
"the",
"determinant",
"for",
"the",
"specified",
"matrix",
".",
"It",
"must",
"be",
"square",
"and",
"have",
"the",
"same",
"width",
"and",
"height",
"as",
"what",
"was",
"specified",
"in",
"the",
"constructor",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/misc/DeterminantFromMinor_DDRM.java#L113-L171 |
162,320 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/SingularOps_DDRM.java | SingularOps_DDRM.singularValues | public static double[] singularValues( DMatrixRMaj A ) {
SingularValueDecomposition_F64<DMatrixRMaj> svd = DecompositionFactory_DDRM.svd(A.numRows,A.numCols,false,true,true);
if( svd.inputModified() ) {
A = A.copy();
}
if( !svd.decompose(A)) {
throw new RuntimeEx... | java | public static double[] singularValues( DMatrixRMaj A ) {
SingularValueDecomposition_F64<DMatrixRMaj> svd = DecompositionFactory_DDRM.svd(A.numRows,A.numCols,false,true,true);
if( svd.inputModified() ) {
A = A.copy();
}
if( !svd.decompose(A)) {
throw new RuntimeEx... | [
"public",
"static",
"double",
"[",
"]",
"singularValues",
"(",
"DMatrixRMaj",
"A",
")",
"{",
"SingularValueDecomposition_F64",
"<",
"DMatrixRMaj",
">",
"svd",
"=",
"DecompositionFactory_DDRM",
".",
"svd",
"(",
"A",
".",
"numRows",
",",
"A",
".",
"numCols",
","... | Returns an array of all the singular values in A sorted in ascending order
@param A Matrix. Not modified.
@return singular values | [
"Returns",
"an",
"array",
"of",
"all",
"the",
"singular",
"values",
"in",
"A",
"sorted",
"in",
"ascending",
"order"
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/SingularOps_DDRM.java#L48-L69 |
162,321 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/SingularOps_DDRM.java | SingularOps_DDRM.ratioSmallestOverLargest | public static double ratioSmallestOverLargest( double []sv ) {
if( sv.length == 0 )
return Double.NaN;
double min = sv[0];
double max = min;
for (int i = 1; i < sv.length; i++) {
double v = sv[i];
if( v > max )
max = v;
el... | java | public static double ratioSmallestOverLargest( double []sv ) {
if( sv.length == 0 )
return Double.NaN;
double min = sv[0];
double max = min;
for (int i = 1; i < sv.length; i++) {
double v = sv[i];
if( v > max )
max = v;
el... | [
"public",
"static",
"double",
"ratioSmallestOverLargest",
"(",
"double",
"[",
"]",
"sv",
")",
"{",
"if",
"(",
"sv",
".",
"length",
"==",
"0",
")",
"return",
"Double",
".",
"NaN",
";",
"double",
"min",
"=",
"sv",
"[",
"0",
"]",
";",
"double",
"max",
... | Computes the ratio of the smallest value to the largest. Does not assume
the array is sorted first
@param sv array
@return smallest / largest | [
"Computes",
"the",
"ratio",
"of",
"the",
"smallest",
"value",
"to",
"the",
"largest",
".",
"Does",
"not",
"assume",
"the",
"array",
"is",
"sorted",
"first"
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/SingularOps_DDRM.java#L77-L93 |
162,322 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/SingularOps_DDRM.java | SingularOps_DDRM.rank | public static int rank( DMatrixRMaj A ) {
SingularValueDecomposition_F64<DMatrixRMaj> svd = DecompositionFactory_DDRM.svd(A.numRows,A.numCols,false,true,true);
if( svd.inputModified() ) {
A = A.copy();
}
if( !svd.decompose(A)) {
throw new RuntimeException("SVD F... | java | public static int rank( DMatrixRMaj A ) {
SingularValueDecomposition_F64<DMatrixRMaj> svd = DecompositionFactory_DDRM.svd(A.numRows,A.numCols,false,true,true);
if( svd.inputModified() ) {
A = A.copy();
}
if( !svd.decompose(A)) {
throw new RuntimeException("SVD F... | [
"public",
"static",
"int",
"rank",
"(",
"DMatrixRMaj",
"A",
")",
"{",
"SingularValueDecomposition_F64",
"<",
"DMatrixRMaj",
">",
"svd",
"=",
"DecompositionFactory_DDRM",
".",
"svd",
"(",
"A",
".",
"numRows",
",",
"A",
".",
"numCols",
",",
"false",
",",
"true... | Returns the matrix's rank. Automatic selection of threshold
@param A Matrix. Not modified.
@return The rank of the decomposed matrix. | [
"Returns",
"the",
"matrix",
"s",
"rank",
".",
"Automatic",
"selection",
"of",
"threshold"
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/SingularOps_DDRM.java#L129-L150 |
162,323 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/SingularOps_DDRM.java | SingularOps_DDRM.checkSvdMatrixSize | public static void checkSvdMatrixSize(DMatrixRMaj U, boolean tranU, DMatrixRMaj W, DMatrixRMaj V, boolean tranV ) {
int numSingular = Math.min(W.numRows,W.numCols);
boolean compact = W.numRows == W.numCols;
if( compact ) {
if( U != null ) {
if( tranU && U.numRows != ... | java | public static void checkSvdMatrixSize(DMatrixRMaj U, boolean tranU, DMatrixRMaj W, DMatrixRMaj V, boolean tranV ) {
int numSingular = Math.min(W.numRows,W.numCols);
boolean compact = W.numRows == W.numCols;
if( compact ) {
if( U != null ) {
if( tranU && U.numRows != ... | [
"public",
"static",
"void",
"checkSvdMatrixSize",
"(",
"DMatrixRMaj",
"U",
",",
"boolean",
"tranU",
",",
"DMatrixRMaj",
"W",
",",
"DMatrixRMaj",
"V",
",",
"boolean",
"tranV",
")",
"{",
"int",
"numSingular",
"=",
"Math",
".",
"min",
"(",
"W",
".",
"numRows"... | Checks to see if all the provided matrices are the expected size for an SVD. If an error is encountered
then an exception is thrown. This automatically handles compact and non-compact formats | [
"Checks",
"to",
"see",
"if",
"all",
"the",
"provided",
"matrices",
"are",
"the",
"expected",
"size",
"for",
"an",
"SVD",
".",
"If",
"an",
"error",
"is",
"encountered",
"then",
"an",
"exception",
"is",
"thrown",
".",
"This",
"automatically",
"handles",
"com... | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/SingularOps_DDRM.java#L319-L347 |
162,324 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/SingularOps_DDRM.java | SingularOps_DDRM.nullspaceQR | public static DMatrixRMaj nullspaceQR( DMatrixRMaj A , int totalSingular ) {
SolveNullSpaceQR_DDRM solver = new SolveNullSpaceQR_DDRM();
DMatrixRMaj nullspace = new DMatrixRMaj(1,1);
if( !solver.process(A,totalSingular,nullspace))
throw new RuntimeException("Solver failed. try SVD ... | java | public static DMatrixRMaj nullspaceQR( DMatrixRMaj A , int totalSingular ) {
SolveNullSpaceQR_DDRM solver = new SolveNullSpaceQR_DDRM();
DMatrixRMaj nullspace = new DMatrixRMaj(1,1);
if( !solver.process(A,totalSingular,nullspace))
throw new RuntimeException("Solver failed. try SVD ... | [
"public",
"static",
"DMatrixRMaj",
"nullspaceQR",
"(",
"DMatrixRMaj",
"A",
",",
"int",
"totalSingular",
")",
"{",
"SolveNullSpaceQR_DDRM",
"solver",
"=",
"new",
"SolveNullSpaceQR_DDRM",
"(",
")",
";",
"DMatrixRMaj",
"nullspace",
"=",
"new",
"DMatrixRMaj",
"(",
"1"... | Computes the null space using QR decomposition. This is much faster than using SVD
@param A (Input) Matrix
@param totalSingular Number of singular values
@return Null space | [
"Computes",
"the",
"null",
"space",
"using",
"QR",
"decomposition",
".",
"This",
"is",
"much",
"faster",
"than",
"using",
"SVD"
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/SingularOps_DDRM.java#L434-L443 |
162,325 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/SingularOps_DDRM.java | SingularOps_DDRM.nullspaceQRP | public static DMatrixRMaj nullspaceQRP( DMatrixRMaj A , int totalSingular ) {
SolveNullSpaceQRP_DDRM solver = new SolveNullSpaceQRP_DDRM();
DMatrixRMaj nullspace = new DMatrixRMaj(1,1);
if( !solver.process(A,totalSingular,nullspace))
throw new RuntimeException("Solver failed. try S... | java | public static DMatrixRMaj nullspaceQRP( DMatrixRMaj A , int totalSingular ) {
SolveNullSpaceQRP_DDRM solver = new SolveNullSpaceQRP_DDRM();
DMatrixRMaj nullspace = new DMatrixRMaj(1,1);
if( !solver.process(A,totalSingular,nullspace))
throw new RuntimeException("Solver failed. try S... | [
"public",
"static",
"DMatrixRMaj",
"nullspaceQRP",
"(",
"DMatrixRMaj",
"A",
",",
"int",
"totalSingular",
")",
"{",
"SolveNullSpaceQRP_DDRM",
"solver",
"=",
"new",
"SolveNullSpaceQRP_DDRM",
"(",
")",
";",
"DMatrixRMaj",
"nullspace",
"=",
"new",
"DMatrixRMaj",
"(",
... | Computes the null space using QRP decomposition. This is faster than using SVD but slower than QR.
Much more stable than QR though.
@param A (Input) Matrix
@param totalSingular Number of singular values
@return Null space | [
"Computes",
"the",
"null",
"space",
"using",
"QRP",
"decomposition",
".",
"This",
"is",
"faster",
"than",
"using",
"SVD",
"but",
"slower",
"than",
"QR",
".",
"Much",
"more",
"stable",
"than",
"QR",
"though",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/SingularOps_DDRM.java#L452-L461 |
162,326 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/SingularOps_DDRM.java | SingularOps_DDRM.nullspaceSVD | public static DMatrixRMaj nullspaceSVD( DMatrixRMaj A , int totalSingular ) {
SolveNullSpace<DMatrixRMaj> solver = new SolveNullSpaceSvd_DDRM();
DMatrixRMaj nullspace = new DMatrixRMaj(1,1);
if( !solver.process(A,totalSingular,nullspace))
throw new RuntimeException("Solver failed. ... | java | public static DMatrixRMaj nullspaceSVD( DMatrixRMaj A , int totalSingular ) {
SolveNullSpace<DMatrixRMaj> solver = new SolveNullSpaceSvd_DDRM();
DMatrixRMaj nullspace = new DMatrixRMaj(1,1);
if( !solver.process(A,totalSingular,nullspace))
throw new RuntimeException("Solver failed. ... | [
"public",
"static",
"DMatrixRMaj",
"nullspaceSVD",
"(",
"DMatrixRMaj",
"A",
",",
"int",
"totalSingular",
")",
"{",
"SolveNullSpace",
"<",
"DMatrixRMaj",
">",
"solver",
"=",
"new",
"SolveNullSpaceSvd_DDRM",
"(",
")",
";",
"DMatrixRMaj",
"nullspace",
"=",
"new",
"... | Computes the null space using SVD. Slowest bust most stable way to find the solution
@param A (Input) Matrix
@param totalSingular Number of singular values
@return Null space | [
"Computes",
"the",
"null",
"space",
"using",
"SVD",
".",
"Slowest",
"bust",
"most",
"stable",
"way",
"to",
"find",
"the",
"solution"
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/SingularOps_DDRM.java#L470-L479 |
162,327 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/SingularOps_DDRM.java | SingularOps_DDRM.rank | public static int rank(SingularValueDecomposition_F64 svd , double threshold ) {
int numRank=0;
double w[]= svd.getSingularValues();
int N = svd.numberOfSingularValues();
for( int j = 0; j < N; j++ ) {
if( w[j] > threshold)
numRank++;
}
ret... | java | public static int rank(SingularValueDecomposition_F64 svd , double threshold ) {
int numRank=0;
double w[]= svd.getSingularValues();
int N = svd.numberOfSingularValues();
for( int j = 0; j < N; j++ ) {
if( w[j] > threshold)
numRank++;
}
ret... | [
"public",
"static",
"int",
"rank",
"(",
"SingularValueDecomposition_F64",
"svd",
",",
"double",
"threshold",
")",
"{",
"int",
"numRank",
"=",
"0",
";",
"double",
"w",
"[",
"]",
"=",
"svd",
".",
"getSingularValues",
"(",
")",
";",
"int",
"N",
"=",
"svd",
... | Extracts the rank of a matrix using a preexisting decomposition.
@see #singularThreshold(SingularValueDecomposition_F64)
@param svd A precomputed decomposition. Not modified.
@param threshold Tolerance used to determine of a singular value is singular.
@return The rank of the decomposed matrix. | [
"Extracts",
"the",
"rank",
"of",
"a",
"matrix",
"using",
"a",
"preexisting",
"decomposition",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/SingularOps_DDRM.java#L608-L621 |
162,328 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/SingularOps_DDRM.java | SingularOps_DDRM.nullity | public static int nullity(SingularValueDecomposition_F64 svd , double threshold ) {
int ret = 0;
double w[]= svd.getSingularValues();
int N = svd.numberOfSingularValues();
int numCol = svd.numCols();
for( int j = 0; j < N; j++ ) {
if( w[j] <= threshold) ret++;
... | java | public static int nullity(SingularValueDecomposition_F64 svd , double threshold ) {
int ret = 0;
double w[]= svd.getSingularValues();
int N = svd.numberOfSingularValues();
int numCol = svd.numCols();
for( int j = 0; j < N; j++ ) {
if( w[j] <= threshold) ret++;
... | [
"public",
"static",
"int",
"nullity",
"(",
"SingularValueDecomposition_F64",
"svd",
",",
"double",
"threshold",
")",
"{",
"int",
"ret",
"=",
"0",
";",
"double",
"w",
"[",
"]",
"=",
"svd",
".",
"getSingularValues",
"(",
")",
";",
"int",
"N",
"=",
"svd",
... | Extracts the nullity of a matrix using a preexisting decomposition.
@see #singularThreshold(SingularValueDecomposition_F64)
@param svd A precomputed decomposition. Not modified.
@param threshold Tolerance used to determine of a singular value is singular.
@return The nullity of the decomposed matrix. | [
"Extracts",
"the",
"nullity",
"of",
"a",
"matrix",
"using",
"a",
"preexisting",
"decomposition",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/SingularOps_DDRM.java#L645-L658 |
162,329 | lessthanoptimal/ejml | main/ejml-simple/src/org/ejml/simple/SimpleSVD.java | SimpleSVD.getSingularValues | public double[] getSingularValues() {
double ret[] = new double[W.numCols()];
for (int i = 0; i < ret.length; i++) {
ret[i] = getSingleValue(i);
}
return ret;
} | java | public double[] getSingularValues() {
double ret[] = new double[W.numCols()];
for (int i = 0; i < ret.length; i++) {
ret[i] = getSingleValue(i);
}
return ret;
} | [
"public",
"double",
"[",
"]",
"getSingularValues",
"(",
")",
"{",
"double",
"ret",
"[",
"]",
"=",
"new",
"double",
"[",
"W",
".",
"numCols",
"(",
")",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"ret",
".",
"length",
";",
"i",
... | Returns an array of all the singular values | [
"Returns",
"an",
"array",
"of",
"all",
"the",
"singular",
"values"
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-simple/src/org/ejml/simple/SimpleSVD.java#L176-L183 |
162,330 | lessthanoptimal/ejml | main/ejml-simple/src/org/ejml/simple/SimpleSVD.java | SimpleSVD.rank | public int rank() {
if( is64 ) {
return SingularOps_DDRM.rank((SingularValueDecomposition_F64)svd, tol);
} else {
return SingularOps_FDRM.rank((SingularValueDecomposition_F32)svd, (float)tol);
}
} | java | public int rank() {
if( is64 ) {
return SingularOps_DDRM.rank((SingularValueDecomposition_F64)svd, tol);
} else {
return SingularOps_FDRM.rank((SingularValueDecomposition_F32)svd, (float)tol);
}
} | [
"public",
"int",
"rank",
"(",
")",
"{",
"if",
"(",
"is64",
")",
"{",
"return",
"SingularOps_DDRM",
".",
"rank",
"(",
"(",
"SingularValueDecomposition_F64",
")",
"svd",
",",
"tol",
")",
";",
"}",
"else",
"{",
"return",
"SingularOps_FDRM",
".",
"rank",
"("... | Returns the rank of the decomposed matrix.
@see SingularOps_DDRM#rank(SingularValueDecomposition_F64, double)
@return The matrix's rank | [
"Returns",
"the",
"rank",
"of",
"the",
"decomposed",
"matrix",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-simple/src/org/ejml/simple/SimpleSVD.java#L192-L198 |
162,331 | lessthanoptimal/ejml | main/ejml-simple/src/org/ejml/simple/SimpleSVD.java | SimpleSVD.nullity | public int nullity() {
if( is64 ) {
return SingularOps_DDRM.nullity((SingularValueDecomposition_F64)svd, 10.0 * UtilEjml.EPS);
} else {
return SingularOps_FDRM.nullity((SingularValueDecomposition_F32)svd, 5.0f * UtilEjml.F_EPS);
}
} | java | public int nullity() {
if( is64 ) {
return SingularOps_DDRM.nullity((SingularValueDecomposition_F64)svd, 10.0 * UtilEjml.EPS);
} else {
return SingularOps_FDRM.nullity((SingularValueDecomposition_F32)svd, 5.0f * UtilEjml.F_EPS);
}
} | [
"public",
"int",
"nullity",
"(",
")",
"{",
"if",
"(",
"is64",
")",
"{",
"return",
"SingularOps_DDRM",
".",
"nullity",
"(",
"(",
"SingularValueDecomposition_F64",
")",
"svd",
",",
"10.0",
"*",
"UtilEjml",
".",
"EPS",
")",
";",
"}",
"else",
"{",
"return",
... | The nullity of the decomposed matrix.
@see SingularOps_DDRM#nullity(SingularValueDecomposition_F64, double)
@return The matrix's nullity | [
"The",
"nullity",
"of",
"the",
"decomposed",
"matrix",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-simple/src/org/ejml/simple/SimpleSVD.java#L207-L213 |
162,332 | lessthanoptimal/ejml | main/ejml-simple/src/org/ejml/equation/ManagerFunctions.java | ManagerFunctions.isFunctionName | public boolean isFunctionName( String s ) {
if( input1.containsKey(s))
return true;
if( inputN.containsKey(s))
return true;
return false;
} | java | public boolean isFunctionName( String s ) {
if( input1.containsKey(s))
return true;
if( inputN.containsKey(s))
return true;
return false;
} | [
"public",
"boolean",
"isFunctionName",
"(",
"String",
"s",
")",
"{",
"if",
"(",
"input1",
".",
"containsKey",
"(",
"s",
")",
")",
"return",
"true",
";",
"if",
"(",
"inputN",
".",
"containsKey",
"(",
"s",
")",
")",
"return",
"true",
";",
"return",
"fa... | Returns true if the string matches the name of a function | [
"Returns",
"true",
"if",
"the",
"string",
"matches",
"the",
"name",
"of",
"a",
"function"
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-simple/src/org/ejml/equation/ManagerFunctions.java#L47-L54 |
162,333 | lessthanoptimal/ejml | main/ejml-simple/src/org/ejml/equation/ManagerFunctions.java | ManagerFunctions.create | public Operation.Info create( char op , Variable input ) {
switch( op ) {
case '\'':
return Operation.transpose(input, managerTemp);
default:
throw new RuntimeException("Unknown operation " + op);
}
} | java | public Operation.Info create( char op , Variable input ) {
switch( op ) {
case '\'':
return Operation.transpose(input, managerTemp);
default:
throw new RuntimeException("Unknown operation " + op);
}
} | [
"public",
"Operation",
".",
"Info",
"create",
"(",
"char",
"op",
",",
"Variable",
"input",
")",
"{",
"switch",
"(",
"op",
")",
"{",
"case",
"'",
"'",
":",
"return",
"Operation",
".",
"transpose",
"(",
"input",
",",
"managerTemp",
")",
";",
"default",
... | Create a new instance of a single input function from an operator character
@param op Which operation
@param input Input variable
@return Resulting operation | [
"Create",
"a",
"new",
"instance",
"of",
"a",
"single",
"input",
"function",
"from",
"an",
"operator",
"character"
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-simple/src/org/ejml/equation/ManagerFunctions.java#L88-L96 |
162,334 | lessthanoptimal/ejml | main/ejml-simple/src/org/ejml/equation/ManagerFunctions.java | ManagerFunctions.create | public Operation.Info create( Symbol op , Variable left , Variable right ) {
switch( op ) {
case PLUS:
return Operation.add(left, right, managerTemp);
case MINUS:
return Operation.subtract(left, right, managerTemp);
case TIMES:
... | java | public Operation.Info create( Symbol op , Variable left , Variable right ) {
switch( op ) {
case PLUS:
return Operation.add(left, right, managerTemp);
case MINUS:
return Operation.subtract(left, right, managerTemp);
case TIMES:
... | [
"public",
"Operation",
".",
"Info",
"create",
"(",
"Symbol",
"op",
",",
"Variable",
"left",
",",
"Variable",
"right",
")",
"{",
"switch",
"(",
"op",
")",
"{",
"case",
"PLUS",
":",
"return",
"Operation",
".",
"add",
"(",
"left",
",",
"right",
",",
"ma... | Create a new instance of a two input function from an operator character
@param op Which operation
@param left Input variable on left
@param right Input variable on right
@return Resulting operation | [
"Create",
"a",
"new",
"instance",
"of",
"a",
"two",
"input",
"function",
"from",
"an",
"operator",
"character"
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-simple/src/org/ejml/equation/ManagerFunctions.java#L105-L137 |
162,335 | lessthanoptimal/ejml | main/ejml-dsparse/src/org/ejml/sparse/csc/misc/ColumnCounts_DSCC.java | ColumnCounts_DSCC.initialize | void initialize(DMatrixSparseCSC A) {
m = A.numRows;
n = A.numCols;
int s = 4*n + (ata ? (n+m+1) : 0);
gw.reshape(s);
w = gw.data;
// compute the transpose of A
At.reshape(A.numCols,A.numRows,A.nz_length);
CommonOps_DSCC.transpose(A,At,gw);
// i... | java | void initialize(DMatrixSparseCSC A) {
m = A.numRows;
n = A.numCols;
int s = 4*n + (ata ? (n+m+1) : 0);
gw.reshape(s);
w = gw.data;
// compute the transpose of A
At.reshape(A.numCols,A.numRows,A.nz_length);
CommonOps_DSCC.transpose(A,At,gw);
// i... | [
"void",
"initialize",
"(",
"DMatrixSparseCSC",
"A",
")",
"{",
"m",
"=",
"A",
".",
"numRows",
";",
"n",
"=",
"A",
".",
"numCols",
";",
"int",
"s",
"=",
"4",
"*",
"n",
"+",
"(",
"ata",
"?",
"(",
"n",
"+",
"m",
"+",
"1",
")",
":",
"0",
")",
... | Initializes class data structures and parameters | [
"Initializes",
"class",
"data",
"structures",
"and",
"parameters"
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-dsparse/src/org/ejml/sparse/csc/misc/ColumnCounts_DSCC.java#L74-L93 |
162,336 | lessthanoptimal/ejml | main/ejml-dsparse/src/org/ejml/sparse/csc/misc/ColumnCounts_DSCC.java | ColumnCounts_DSCC.process | public void process(DMatrixSparseCSC A , int parent[], int post[], int counts[] ) {
if( counts.length < A.numCols )
throw new IllegalArgumentException("counts must be at least of length A.numCols");
initialize(A);
int delta[] = counts;
findFirstDescendant(parent, post, delt... | java | public void process(DMatrixSparseCSC A , int parent[], int post[], int counts[] ) {
if( counts.length < A.numCols )
throw new IllegalArgumentException("counts must be at least of length A.numCols");
initialize(A);
int delta[] = counts;
findFirstDescendant(parent, post, delt... | [
"public",
"void",
"process",
"(",
"DMatrixSparseCSC",
"A",
",",
"int",
"parent",
"[",
"]",
",",
"int",
"post",
"[",
"]",
",",
"int",
"counts",
"[",
"]",
")",
"{",
"if",
"(",
"counts",
".",
"length",
"<",
"A",
".",
"numCols",
")",
"throw",
"new",
... | Processes and computes column counts of A
@param A (Input) Upper triangular matrix
@param parent (Input) Elimination tree.
@param post (Input) Post order permutation of elimination tree. See {@link TriangularSolver_DSCC#postorder}
@param counts (Output) Storage for column counts. | [
"Processes",
"and",
"computes",
"column",
"counts",
"of",
"A"
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-dsparse/src/org/ejml/sparse/csc/misc/ColumnCounts_DSCC.java#L103-L143 |
162,337 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/DMatrixVisualization.java | DMatrixVisualization.show | public static void show(DMatrixD1 A , String title ) {
JFrame frame = new JFrame(title);
int width = 300;
int height = 300;
if( A.numRows > A.numCols) {
width = width*A.numCols/A.numRows;
} else {
height = height*A.numRows/A.numCols;
}
D... | java | public static void show(DMatrixD1 A , String title ) {
JFrame frame = new JFrame(title);
int width = 300;
int height = 300;
if( A.numRows > A.numCols) {
width = width*A.numCols/A.numRows;
} else {
height = height*A.numRows/A.numCols;
}
D... | [
"public",
"static",
"void",
"show",
"(",
"DMatrixD1",
"A",
",",
"String",
"title",
")",
"{",
"JFrame",
"frame",
"=",
"new",
"JFrame",
"(",
"title",
")",
";",
"int",
"width",
"=",
"300",
";",
"int",
"height",
"=",
"300",
";",
"if",
"(",
"A",
".",
... | Creates a window visually showing the matrix's state. Block means an element is zero.
Red positive and blue negative. More intense the color larger the element's absolute value
is.
@param A A matrix.
@param title Name of the window. | [
"Creates",
"a",
"window",
"visually",
"showing",
"the",
"matrix",
"s",
"state",
".",
"Block",
"means",
"an",
"element",
"is",
"zero",
".",
"Red",
"positive",
"and",
"blue",
"negative",
".",
"More",
"intense",
"the",
"color",
"larger",
"the",
"element",
"s"... | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/DMatrixVisualization.java#L48-L68 |
162,338 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/decomposition/eig/EigenvalueSmall_F64.java | EigenvalueSmall_F64.value2x2 | public void value2x2( double a11 , double a12, double a21 , double a22 )
{
// apply a rotators such that th a11 and a22 elements are the same
double c,s;
if( a12 + a21 == 0 ) { // is this pointless since
c = s = 1.0 / Math.sqrt(2);
} else {
double aa = (a11-a... | java | public void value2x2( double a11 , double a12, double a21 , double a22 )
{
// apply a rotators such that th a11 and a22 elements are the same
double c,s;
if( a12 + a21 == 0 ) { // is this pointless since
c = s = 1.0 / Math.sqrt(2);
} else {
double aa = (a11-a... | [
"public",
"void",
"value2x2",
"(",
"double",
"a11",
",",
"double",
"a12",
",",
"double",
"a21",
",",
"double",
"a22",
")",
"{",
"// apply a rotators such that th a11 and a22 elements are the same",
"double",
"c",
",",
"s",
";",
"if",
"(",
"a12",
"+",
"a21",
"=... | if |a11-a22| >> |a12+a21| there might be a better way. see pg371 | [
"if",
"|a11",
"-",
"a22|",
">>",
"|a12",
"+",
"a21|",
"there",
"might",
"be",
"a",
"better",
"way",
".",
"see",
"pg371"
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/decomposition/eig/EigenvalueSmall_F64.java#L33-L89 |
162,339 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/decomposition/eig/EigenvalueSmall_F64.java | EigenvalueSmall_F64.value2x2_fast | public void value2x2_fast( double a11 , double a12, double a21 , double a22 )
{
double left = (a11+a22)/2.0;
double inside = 4.0*a12*a21 + (a11-a22)*(a11-a22);
if( inside < 0 ) {
value0.real = value1.real = left;
value0.imaginary = Math.sqrt(-inside)/2.0;
... | java | public void value2x2_fast( double a11 , double a12, double a21 , double a22 )
{
double left = (a11+a22)/2.0;
double inside = 4.0*a12*a21 + (a11-a22)*(a11-a22);
if( inside < 0 ) {
value0.real = value1.real = left;
value0.imaginary = Math.sqrt(-inside)/2.0;
... | [
"public",
"void",
"value2x2_fast",
"(",
"double",
"a11",
",",
"double",
"a12",
",",
"double",
"a21",
",",
"double",
"a22",
")",
"{",
"double",
"left",
"=",
"(",
"a11",
"+",
"a22",
")",
"/",
"2.0",
";",
"double",
"inside",
"=",
"4.0",
"*",
"a12",
"*... | Computes the eigenvalues of a 2 by 2 matrix using a faster but more prone to errors method. This
is the typical method. | [
"Computes",
"the",
"eigenvalues",
"of",
"a",
"2",
"by",
"2",
"matrix",
"using",
"a",
"faster",
"but",
"more",
"prone",
"to",
"errors",
"method",
".",
"This",
"is",
"the",
"typical",
"method",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/decomposition/eig/EigenvalueSmall_F64.java#L95-L110 |
162,340 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/decomposition/eig/EigenvalueSmall_F64.java | EigenvalueSmall_F64.symm2x2_fast | public void symm2x2_fast( double a11 , double a12, double a22 )
{
// double p = (a11 - a22)*0.5;
// double r = Math.sqrt(p*p + a12*a12);
//
// value0.real = a22 + a12*a12/(r-p);
// value1.real = a22 - a12*a12/(r+p);
// }
//
// public void symm2x2_std( double a11 , double a12, doubl... | java | public void symm2x2_fast( double a11 , double a12, double a22 )
{
// double p = (a11 - a22)*0.5;
// double r = Math.sqrt(p*p + a12*a12);
//
// value0.real = a22 + a12*a12/(r-p);
// value1.real = a22 - a12*a12/(r+p);
// }
//
// public void symm2x2_std( double a11 , double a12, doubl... | [
"public",
"void",
"symm2x2_fast",
"(",
"double",
"a11",
",",
"double",
"a12",
",",
"double",
"a22",
")",
"{",
"// double p = (a11 - a22)*0.5;",
"// double r = Math.sqrt(p*p + a12*a12);",
"//",
"// value0.real = a22 + a12*a12/(r-p);",
"// value1.real = ... | See page 385 of Fundamentals of Matrix Computations 2nd | [
"See",
"page",
"385",
"of",
"Fundamentals",
"of",
"Matrix",
"Computations",
"2nd"
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/decomposition/eig/EigenvalueSmall_F64.java#L116-L132 |
162,341 | lessthanoptimal/ejml | main/ejml-experimental/benchmarks/src/org/ejml/dense/row/mult/BenchmarkMatrixMultAccessors.java | BenchmarkMatrixMultAccessors.wrapped | public static long wrapped(DMatrixRMaj a , DMatrixRMaj b , DMatrixRMaj c )
{
long timeBefore = System.currentTimeMillis();
double valA;
int indexCbase= 0;
int endOfKLoop = b.numRows*b.numCols;
for( int i = 0; i < a.numRows; i++ ) {
int indexA = i*a.numCols;
... | java | public static long wrapped(DMatrixRMaj a , DMatrixRMaj b , DMatrixRMaj c )
{
long timeBefore = System.currentTimeMillis();
double valA;
int indexCbase= 0;
int endOfKLoop = b.numRows*b.numCols;
for( int i = 0; i < a.numRows; i++ ) {
int indexA = i*a.numCols;
... | [
"public",
"static",
"long",
"wrapped",
"(",
"DMatrixRMaj",
"a",
",",
"DMatrixRMaj",
"b",
",",
"DMatrixRMaj",
"c",
")",
"{",
"long",
"timeBefore",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"double",
"valA",
";",
"int",
"indexCbase",
"=",
"0",
... | Wrapper functions with no bounds checking are used to access matrix internals | [
"Wrapper",
"functions",
"with",
"no",
"bounds",
"checking",
"are",
"used",
"to",
"access",
"matrix",
"internals"
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-experimental/benchmarks/src/org/ejml/dense/row/mult/BenchmarkMatrixMultAccessors.java#L83-L119 |
162,342 | lessthanoptimal/ejml | main/ejml-experimental/benchmarks/src/org/ejml/dense/row/mult/BenchmarkMatrixMultAccessors.java | BenchmarkMatrixMultAccessors.access2d | public static long access2d(DMatrixRMaj a , DMatrixRMaj b , DMatrixRMaj c )
{
long timeBefore = System.currentTimeMillis();
for( int i = 0; i < a.numRows; i++ ) {
for( int j = 0; j < b.numCols; j++ ) {
c.set(i,j,a.get(i,0)*b.get(0,j));
}
for( in... | java | public static long access2d(DMatrixRMaj a , DMatrixRMaj b , DMatrixRMaj c )
{
long timeBefore = System.currentTimeMillis();
for( int i = 0; i < a.numRows; i++ ) {
for( int j = 0; j < b.numCols; j++ ) {
c.set(i,j,a.get(i,0)*b.get(0,j));
}
for( in... | [
"public",
"static",
"long",
"access2d",
"(",
"DMatrixRMaj",
"a",
",",
"DMatrixRMaj",
"b",
",",
"DMatrixRMaj",
"c",
")",
"{",
"long",
"timeBefore",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
... | Only sets and gets that are by row and column are used. | [
"Only",
"sets",
"and",
"gets",
"that",
"are",
"by",
"row",
"and",
"column",
"are",
"used",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-experimental/benchmarks/src/org/ejml/dense/row/mult/BenchmarkMatrixMultAccessors.java#L124-L143 |
162,343 | lessthanoptimal/ejml | main/ejml-core/src/org/ejml/FancyPrint.java | FancyPrint.p | public String p(double value ) {
return UtilEjml.fancyString(value,format,false,length,significant);
} | java | public String p(double value ) {
return UtilEjml.fancyString(value,format,false,length,significant);
} | [
"public",
"String",
"p",
"(",
"double",
"value",
")",
"{",
"return",
"UtilEjml",
".",
"fancyString",
"(",
"value",
",",
"format",
",",
"false",
",",
"length",
",",
"significant",
")",
";",
"}"
] | Fancy print without a space added to positive numbers | [
"Fancy",
"print",
"without",
"a",
"space",
"added",
"to",
"positive",
"numbers"
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-core/src/org/ejml/FancyPrint.java#L61-L63 |
162,344 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/decomposition/eig/symm/SymmetricQrAlgorithm_DDRM.java | SymmetricQrAlgorithm_DDRM.process | public boolean process( int sideLength,
double diag[] ,
double off[] ,
double eigenvalues[] ) {
if( diag != null )
helper.init(diag,off,sideLength);
if( Q == null )
Q = CommonOps_DDRM.identity(hel... | java | public boolean process( int sideLength,
double diag[] ,
double off[] ,
double eigenvalues[] ) {
if( diag != null )
helper.init(diag,off,sideLength);
if( Q == null )
Q = CommonOps_DDRM.identity(hel... | [
"public",
"boolean",
"process",
"(",
"int",
"sideLength",
",",
"double",
"diag",
"[",
"]",
",",
"double",
"off",
"[",
"]",
",",
"double",
"eigenvalues",
"[",
"]",
")",
"{",
"if",
"(",
"diag",
"!=",
"null",
")",
"helper",
".",
"init",
"(",
"diag",
"... | Computes the eigenvalue of the provided tridiagonal matrix. Note that only the upper portion
needs to be tridiagonal. The bottom diagonal is assumed to be the same as the top.
@param sideLength Number of rows and columns in the input matrix.
@param diag Diagonal elements from tridiagonal matrix. Modified.
@param off... | [
"Computes",
"the",
"eigenvalue",
"of",
"the",
"provided",
"tridiagonal",
"matrix",
".",
"Note",
"that",
"only",
"the",
"upper",
"portion",
"needs",
"to",
"be",
"tridiagonal",
".",
"The",
"bottom",
"diagonal",
"is",
"assumed",
"to",
"be",
"the",
"same",
"as",... | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/decomposition/eig/symm/SymmetricQrAlgorithm_DDRM.java#L111-L126 |
162,345 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/decomposition/eig/symm/SymmetricQrAlgorithm_DDRM.java | SymmetricQrAlgorithm_DDRM.performStep | public void performStep() {
// check for zeros
for( int i = helper.x2-1; i >= helper.x1; i-- ) {
if( helper.isZero(i) ) {
helper.splits[helper.numSplits++] = i;
helper.x1 = i+1;
return;
}
}
double lambda;
i... | java | public void performStep() {
// check for zeros
for( int i = helper.x2-1; i >= helper.x1; i-- ) {
if( helper.isZero(i) ) {
helper.splits[helper.numSplits++] = i;
helper.x1 = i+1;
return;
}
}
double lambda;
i... | [
"public",
"void",
"performStep",
"(",
")",
"{",
"// check for zeros",
"for",
"(",
"int",
"i",
"=",
"helper",
".",
"x2",
"-",
"1",
";",
"i",
">=",
"helper",
".",
"x1",
";",
"i",
"--",
")",
"{",
"if",
"(",
"helper",
".",
"isZero",
"(",
"i",
")",
... | First looks for zeros and then performs the implicit single step in the QR Algorithm. | [
"First",
"looks",
"for",
"zeros",
"and",
"then",
"performs",
"the",
"implicit",
"single",
"step",
"in",
"the",
"QR",
"Algorithm",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/decomposition/eig/symm/SymmetricQrAlgorithm_DDRM.java#L177-L205 |
162,346 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/misc/TransposeAlgs_DDRM.java | TransposeAlgs_DDRM.block | public static void block(DMatrix1Row A , DMatrix1Row A_tran ,
final int blockLength )
{
for( int i = 0; i < A.numRows; i += blockLength ) {
int blockHeight = Math.min( blockLength , A.numRows - i);
int indexSrc = i*A.numCols;
int indexDst = i... | java | public static void block(DMatrix1Row A , DMatrix1Row A_tran ,
final int blockLength )
{
for( int i = 0; i < A.numRows; i += blockLength ) {
int blockHeight = Math.min( blockLength , A.numRows - i);
int indexSrc = i*A.numCols;
int indexDst = i... | [
"public",
"static",
"void",
"block",
"(",
"DMatrix1Row",
"A",
",",
"DMatrix1Row",
"A_tran",
",",
"final",
"int",
"blockLength",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"A",
".",
"numRows",
";",
"i",
"+=",
"blockLength",
")",
"{",
... | Performs a transpose across block sub-matrices. Reduces
the number of cache misses on larger matrices.
*NOTE* If this is beneficial is highly dependent on the computer it is run on. e.g:
- Q6600 Almost twice as fast as standard.
- Pentium-M Same speed and some times a bit slower than standard.
@param A Original matr... | [
"Performs",
"a",
"transpose",
"across",
"block",
"sub",
"-",
"matrices",
".",
"Reduces",
"the",
"number",
"of",
"cache",
"misses",
"on",
"larger",
"matrices",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/misc/TransposeAlgs_DDRM.java#L65-L95 |
162,347 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/generic/GenericMatrixOps_F64.java | GenericMatrixOps_F64.isIdentity | public static boolean isIdentity(DMatrix a , double tol )
{
for( int i = 0; i < a.getNumRows(); i++ ) {
for( int j = 0; j < a.getNumCols(); j++ ) {
if( i == j ) {
if( Math.abs(a.get(i,j)-1.0) > tol )
return false;
} else... | java | public static boolean isIdentity(DMatrix a , double tol )
{
for( int i = 0; i < a.getNumRows(); i++ ) {
for( int j = 0; j < a.getNumCols(); j++ ) {
if( i == j ) {
if( Math.abs(a.get(i,j)-1.0) > tol )
return false;
} else... | [
"public",
"static",
"boolean",
"isIdentity",
"(",
"DMatrix",
"a",
",",
"double",
"tol",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"a",
".",
"getNumRows",
"(",
")",
";",
"i",
"++",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"0",
"... | Returns true if the provided matrix is has a value of 1 along the diagonal
elements and zero along all the other elements.
@param a Matrix being inspected.
@param tol How close to zero or one each element needs to be.
@return If it is within tolerance to an identity matrix. | [
"Returns",
"true",
"if",
"the",
"provided",
"matrix",
"is",
"has",
"a",
"value",
"of",
"1",
"along",
"the",
"diagonal",
"elements",
"and",
"zero",
"along",
"all",
"the",
"other",
"elements",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/generic/GenericMatrixOps_F64.java#L63-L77 |
162,348 | lessthanoptimal/ejml | main/ejml-dsparse/src/org/ejml/sparse/csc/decomposition/qr/QrHelperFunctions_DSCC.java | QrHelperFunctions_DSCC.computeHouseholder | public static double computeHouseholder(double []x , int xStart , int xEnd , double max , DScalar gamma ) {
double tau = 0;
for (int i = xStart; i < xEnd ; i++) {
double val = x[i] /= max;
tau += val*val;
}
tau = Math.sqrt(tau);
if( x[xStart] < 0 ) {
... | java | public static double computeHouseholder(double []x , int xStart , int xEnd , double max , DScalar gamma ) {
double tau = 0;
for (int i = xStart; i < xEnd ; i++) {
double val = x[i] /= max;
tau += val*val;
}
tau = Math.sqrt(tau);
if( x[xStart] < 0 ) {
... | [
"public",
"static",
"double",
"computeHouseholder",
"(",
"double",
"[",
"]",
"x",
",",
"int",
"xStart",
",",
"int",
"xEnd",
",",
"double",
"max",
",",
"DScalar",
"gamma",
")",
"{",
"double",
"tau",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"xStart"... | Creates a householder reflection.
(I-gamma*v*v')*x = tau*e1
<p>NOTE: Same as cs_house in csparse</p>
@param x (Input) Vector x (Output) Vector v. Modified.
@param xStart First index in X that is to be processed
@param xEnd Last + 1 index in x that is to be processed.
@param gamma (Output) Storage for computed gamma
@... | [
"Creates",
"a",
"householder",
"reflection",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-dsparse/src/org/ejml/sparse/csc/decomposition/qr/QrHelperFunctions_DSCC.java#L110-L128 |
162,349 | lessthanoptimal/ejml | main/ejml-experimental/benchmarks/src/org/ejml/BenchmarkInliningGetSet.java | BenchmarkInliningGetSet.get1D | public static long get1D(DMatrixRMaj A , int n ) {
long before = System.currentTimeMillis();
double total = 0;
for( int iter = 0; iter < n; iter++ ) {
int index = 0;
for( int i = 0; i < A.numRows; i++ ) {
int end = index+A.numCols;
whil... | java | public static long get1D(DMatrixRMaj A , int n ) {
long before = System.currentTimeMillis();
double total = 0;
for( int iter = 0; iter < n; iter++ ) {
int index = 0;
for( int i = 0; i < A.numRows; i++ ) {
int end = index+A.numCols;
whil... | [
"public",
"static",
"long",
"get1D",
"(",
"DMatrixRMaj",
"A",
",",
"int",
"n",
")",
"{",
"long",
"before",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"double",
"total",
"=",
"0",
";",
"for",
"(",
"int",
"iter",
"=",
"0",
";",
"iter",
"... | Get by index is used here. | [
"Get",
"by",
"index",
"is",
"used",
"here",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-experimental/benchmarks/src/org/ejml/BenchmarkInliningGetSet.java#L91-L115 |
162,350 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/block/decomposition/qr/QRDecompositionHouseholder_DDRB.java | QRDecompositionHouseholder_DDRB.initializeQ | public static DMatrixRBlock initializeQ(DMatrixRBlock Q,
int numRows , int numCols , int blockLength ,
boolean compact) {
int minLength = Math.min(numRows,numCols);
if( compact ) {
if( Q == null ) {
... | java | public static DMatrixRBlock initializeQ(DMatrixRBlock Q,
int numRows , int numCols , int blockLength ,
boolean compact) {
int minLength = Math.min(numRows,numCols);
if( compact ) {
if( Q == null ) {
... | [
"public",
"static",
"DMatrixRBlock",
"initializeQ",
"(",
"DMatrixRBlock",
"Q",
",",
"int",
"numRows",
",",
"int",
"numCols",
",",
"int",
"blockLength",
",",
"boolean",
"compact",
")",
"{",
"int",
"minLength",
"=",
"Math",
".",
"min",
"(",
"numRows",
",",
"... | Sanity checks the input or declares a new matrix. Return matrix is an identity matrix. | [
"Sanity",
"checks",
"the",
"input",
"or",
"declares",
"a",
"new",
"matrix",
".",
"Return",
"matrix",
"is",
"an",
"identity",
"matrix",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/block/decomposition/qr/QRDecompositionHouseholder_DDRB.java#L124-L152 |
162,351 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/block/decomposition/qr/QRDecompositionHouseholder_DDRB.java | QRDecompositionHouseholder_DDRB.setup | private void setup(DMatrixRBlock orig) {
blockLength = orig.blockLength;
dataW.blockLength = blockLength;
dataWTA.blockLength = blockLength;
this.dataA = orig;
A.original = dataA;
int l = Math.min(blockLength,orig.numCols);
dataW.reshape(orig.numRows,l,false);
... | java | private void setup(DMatrixRBlock orig) {
blockLength = orig.blockLength;
dataW.blockLength = blockLength;
dataWTA.blockLength = blockLength;
this.dataA = orig;
A.original = dataA;
int l = Math.min(blockLength,orig.numCols);
dataW.reshape(orig.numRows,l,false);
... | [
"private",
"void",
"setup",
"(",
"DMatrixRBlock",
"orig",
")",
"{",
"blockLength",
"=",
"orig",
".",
"blockLength",
";",
"dataW",
".",
"blockLength",
"=",
"blockLength",
";",
"dataWTA",
".",
"blockLength",
"=",
"blockLength",
";",
"this",
".",
"dataA",
"=",
... | Adjust submatrices and helper data structures for the input matrix. Must be called
before the decomposition can be computed.
@param orig | [
"Adjust",
"submatrices",
"and",
"helper",
"data",
"structures",
"for",
"the",
"input",
"matrix",
".",
"Must",
"be",
"called",
"before",
"the",
"decomposition",
"can",
"be",
"computed",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/block/decomposition/qr/QRDecompositionHouseholder_DDRB.java#L326-L347 |
162,352 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/block/decomposition/qr/QRDecompositionHouseholder_DDRB.java | QRDecompositionHouseholder_DDRB.setW | private void setW() {
if( saveW ) {
W.col0 = Y.col0;
W.col1 = Y.col1;
W.row0 = Y.row0;
W.row1 = Y.row1;
} else {
W.col1 = Y.col1 - Y.col0;
W.row0 = Y.row0;
}
} | java | private void setW() {
if( saveW ) {
W.col0 = Y.col0;
W.col1 = Y.col1;
W.row0 = Y.row0;
W.row1 = Y.row1;
} else {
W.col1 = Y.col1 - Y.col0;
W.row0 = Y.row0;
}
} | [
"private",
"void",
"setW",
"(",
")",
"{",
"if",
"(",
"saveW",
")",
"{",
"W",
".",
"col0",
"=",
"Y",
".",
"col0",
";",
"W",
".",
"col1",
"=",
"Y",
".",
"col1",
";",
"W",
".",
"row0",
"=",
"Y",
".",
"row0",
";",
"W",
".",
"row1",
"=",
"Y",
... | Sets the submatrix of W up give Y is already configured and if it is being cached or not. | [
"Sets",
"the",
"submatrix",
"of",
"W",
"up",
"give",
"Y",
"is",
"already",
"configured",
"and",
"if",
"it",
"is",
"being",
"cached",
"or",
"not",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/block/decomposition/qr/QRDecompositionHouseholder_DDRB.java#L385-L395 |
162,353 | lessthanoptimal/ejml | main/ejml-zdense/src/org/ejml/dense/row/linsol/chol/LinearSolverChol_ZDRM.java | LinearSolverChol_ZDRM.solveInternalL | private void solveInternalL() {
// This takes advantage of the diagonal elements always being real numbers
// solve L*y=b storing y in x
TriangularSolver_ZDRM.solveL_diagReal(t, vv, n);
// solve L^T*x=y
TriangularSolver_ZDRM.solveConjTranL_diagReal(t, vv, n);
} | java | private void solveInternalL() {
// This takes advantage of the diagonal elements always being real numbers
// solve L*y=b storing y in x
TriangularSolver_ZDRM.solveL_diagReal(t, vv, n);
// solve L^T*x=y
TriangularSolver_ZDRM.solveConjTranL_diagReal(t, vv, n);
} | [
"private",
"void",
"solveInternalL",
"(",
")",
"{",
"// This takes advantage of the diagonal elements always being real numbers",
"// solve L*y=b storing y in x",
"TriangularSolver_ZDRM",
".",
"solveL_diagReal",
"(",
"t",
",",
"vv",
",",
"n",
")",
";",
"// solve L^T*x=y",
"Tr... | Used internally to find the solution to a single column vector. | [
"Used",
"internally",
"to",
"find",
"the",
"solution",
"to",
"a",
"single",
"column",
"vector",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/linsol/chol/LinearSolverChol_ZDRM.java#L114-L122 |
162,354 | lessthanoptimal/ejml | main/ejml-zdense/src/org/ejml/dense/row/linsol/chol/LinearSolverChol_ZDRM.java | LinearSolverChol_ZDRM.invert | @Override
public void invert( ZMatrixRMaj inv ) {
if( inv.numRows != n || inv.numCols != n ) {
throw new RuntimeException("Unexpected matrix dimension");
}
if( inv.data == t ) {
throw new IllegalArgumentException("Passing in the same matrix that was decomposed.");
... | java | @Override
public void invert( ZMatrixRMaj inv ) {
if( inv.numRows != n || inv.numCols != n ) {
throw new RuntimeException("Unexpected matrix dimension");
}
if( inv.data == t ) {
throw new IllegalArgumentException("Passing in the same matrix that was decomposed.");
... | [
"@",
"Override",
"public",
"void",
"invert",
"(",
"ZMatrixRMaj",
"inv",
")",
"{",
"if",
"(",
"inv",
".",
"numRows",
"!=",
"n",
"||",
"inv",
".",
"numCols",
"!=",
"n",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Unexpected matrix dimension\"",
")"... | Sets the matrix 'inv' equal to the inverse of the matrix that was decomposed.
@param inv Where the value of the inverse will be stored. Modified. | [
"Sets",
"the",
"matrix",
"inv",
"equal",
"to",
"the",
"inverse",
"of",
"the",
"matrix",
"that",
"was",
"decomposed",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/linsol/chol/LinearSolverChol_ZDRM.java#L129-L143 |
162,355 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/decomposition/qr/QrUpdate_DDRM.java | QrUpdate_DDRM.declareInternalData | public void declareInternalData(int maxRows, int maxCols) {
this.maxRows = maxRows;
this.maxCols = maxCols;
U_tran = new DMatrixRMaj(maxRows,maxRows);
Qm = new DMatrixRMaj(maxRows,maxRows);
r_row = new double[ maxCols ];
} | java | public void declareInternalData(int maxRows, int maxCols) {
this.maxRows = maxRows;
this.maxCols = maxCols;
U_tran = new DMatrixRMaj(maxRows,maxRows);
Qm = new DMatrixRMaj(maxRows,maxRows);
r_row = new double[ maxCols ];
} | [
"public",
"void",
"declareInternalData",
"(",
"int",
"maxRows",
",",
"int",
"maxCols",
")",
"{",
"this",
".",
"maxRows",
"=",
"maxRows",
";",
"this",
".",
"maxCols",
"=",
"maxCols",
";",
"U_tran",
"=",
"new",
"DMatrixRMaj",
"(",
"maxRows",
",",
"maxRows",
... | Declares the internal data structures so that it can process matrices up to the specified size.
@param maxRows
@param maxCols | [
"Declares",
"the",
"internal",
"data",
"structures",
"so",
"that",
"it",
"can",
"process",
"matrices",
"up",
"to",
"the",
"specified",
"size",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/decomposition/qr/QrUpdate_DDRM.java#L114-L122 |
162,356 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/decomposition/qr/QrUpdate_DDRM.java | QrUpdate_DDRM.setQR | private void setQR(DMatrixRMaj Q , DMatrixRMaj R , int growRows ) {
if( Q.numRows != Q.numCols ) {
throw new IllegalArgumentException("Q should be square.");
}
this.Q = Q;
this.R = R;
m = Q.numRows;
n = R.numCols;
if( m+growRows > maxRows || n > max... | java | private void setQR(DMatrixRMaj Q , DMatrixRMaj R , int growRows ) {
if( Q.numRows != Q.numCols ) {
throw new IllegalArgumentException("Q should be square.");
}
this.Q = Q;
this.R = R;
m = Q.numRows;
n = R.numCols;
if( m+growRows > maxRows || n > max... | [
"private",
"void",
"setQR",
"(",
"DMatrixRMaj",
"Q",
",",
"DMatrixRMaj",
"R",
",",
"int",
"growRows",
")",
"{",
"if",
"(",
"Q",
".",
"numRows",
"!=",
"Q",
".",
"numCols",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Q should be square.\"",
... | Provides the results of a QR decomposition. These will be modified by adding or removing
rows from the original 'A' matrix.
@param Q The Q matrix which is to be modified. Is modified later and reference saved.
@param R The R matrix which is to be modified. Is modified later and reference saved. | [
"Provides",
"the",
"results",
"of",
"a",
"QR",
"decomposition",
".",
"These",
"will",
"be",
"modified",
"by",
"adding",
"or",
"removing",
"rows",
"from",
"the",
"original",
"A",
"matrix",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/decomposition/qr/QrUpdate_DDRM.java#L215-L234 |
162,357 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/decomposition/qr/QrUpdate_DDRM.java | QrUpdate_DDRM.updateRemoveQ | private void updateRemoveQ( int rowIndex ) {
Qm.set(Q);
Q.reshape(m_m,m_m, false);
for( int i = 0; i < rowIndex; i++ ) {
for( int j = 1; j < m; j++ ) {
double sum = 0;
for( int k = 0; k < m; k++ ) {
sum += Qm.data[i*m+k]* U_tran.da... | java | private void updateRemoveQ( int rowIndex ) {
Qm.set(Q);
Q.reshape(m_m,m_m, false);
for( int i = 0; i < rowIndex; i++ ) {
for( int j = 1; j < m; j++ ) {
double sum = 0;
for( int k = 0; k < m; k++ ) {
sum += Qm.data[i*m+k]* U_tran.da... | [
"private",
"void",
"updateRemoveQ",
"(",
"int",
"rowIndex",
")",
"{",
"Qm",
".",
"set",
"(",
"Q",
")",
";",
"Q",
".",
"reshape",
"(",
"m_m",
",",
"m_m",
",",
"false",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"rowIndex",
";",
... | Updates the Q matrix to take inaccount the row that was removed by only multiplying e
lements that need to be. There is still some room for improvement here...
@param rowIndex | [
"Updates",
"the",
"Q",
"matrix",
"to",
"take",
"inaccount",
"the",
"row",
"that",
"was",
"removed",
"by",
"only",
"multiplying",
"e",
"lements",
"that",
"need",
"to",
"be",
".",
"There",
"is",
"still",
"some",
"room",
"for",
"improvement",
"here",
"..."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/decomposition/qr/QrUpdate_DDRM.java#L275-L298 |
162,358 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/decomposition/qr/QrUpdate_DDRM.java | QrUpdate_DDRM.updateRemoveR | private void updateRemoveR() {
for( int i = 1; i < n+1; i++ ) {
for( int j = 0; j < n; j++ ) {
double sum = 0;
for( int k = i-1; k <= j; k++ ) {
sum += U_tran.data[i*m+k] * R.data[k*n+j];
}
R.data[(i-1)*n+j] = sum;
... | java | private void updateRemoveR() {
for( int i = 1; i < n+1; i++ ) {
for( int j = 0; j < n; j++ ) {
double sum = 0;
for( int k = i-1; k <= j; k++ ) {
sum += U_tran.data[i*m+k] * R.data[k*n+j];
}
R.data[(i-1)*n+j] = sum;
... | [
"private",
"void",
"updateRemoveR",
"(",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"i",
"<",
"n",
"+",
"1",
";",
"i",
"++",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",
"<",
"n",
";",
"j",
"++",
")",
"{",
"double",
"sum",
... | Updates the R matrix to take in account the removed row. | [
"Updates",
"the",
"R",
"matrix",
"to",
"take",
"in",
"account",
"the",
"removed",
"row",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/decomposition/qr/QrUpdate_DDRM.java#L303-L313 |
162,359 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/NormOps_DDRM.java | NormOps_DDRM.normalizeF | public static void normalizeF( DMatrixRMaj A ) {
double val = normF(A);
if( val == 0 )
return;
int size = A.getNumElements();
for( int i = 0; i < size; i++) {
A.div(i , val);
}
} | java | public static void normalizeF( DMatrixRMaj A ) {
double val = normF(A);
if( val == 0 )
return;
int size = A.getNumElements();
for( int i = 0; i < size; i++) {
A.div(i , val);
}
} | [
"public",
"static",
"void",
"normalizeF",
"(",
"DMatrixRMaj",
"A",
")",
"{",
"double",
"val",
"=",
"normF",
"(",
"A",
")",
";",
"if",
"(",
"val",
"==",
"0",
")",
"return",
";",
"int",
"size",
"=",
"A",
".",
"getNumElements",
"(",
")",
";",
"for",
... | Normalizes the matrix such that the Frobenius norm is equal to one.
@param A The matrix that is to be normalized. | [
"Normalizes",
"the",
"matrix",
"such",
"that",
"the",
"Frobenius",
"norm",
"is",
"equal",
"to",
"one",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/NormOps_DDRM.java#L71-L82 |
162,360 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/NormOps_DDRM.java | NormOps_DDRM.normP | public static double normP(DMatrixRMaj A , double p ) {
if( p == 1 ) {
return normP1(A);
} else if( p == 2 ) {
return normP2(A);
} else if( Double.isInfinite(p)) {
return normPInf(A);
}
if( MatrixFeatures_DDRM.isVector(A) ) {
return... | java | public static double normP(DMatrixRMaj A , double p ) {
if( p == 1 ) {
return normP1(A);
} else if( p == 2 ) {
return normP2(A);
} else if( Double.isInfinite(p)) {
return normPInf(A);
}
if( MatrixFeatures_DDRM.isVector(A) ) {
return... | [
"public",
"static",
"double",
"normP",
"(",
"DMatrixRMaj",
"A",
",",
"double",
"p",
")",
"{",
"if",
"(",
"p",
"==",
"1",
")",
"{",
"return",
"normP1",
"(",
"A",
")",
";",
"}",
"else",
"if",
"(",
"p",
"==",
"2",
")",
"{",
"return",
"normP2",
"("... | Computes either the vector p-norm or the induced matrix p-norm depending on A
being a vector or a matrix respectively.
@param A Vector or matrix whose norm is to be computed.
@param p The p value of the p-norm.
@return The computed norm. | [
"Computes",
"either",
"the",
"vector",
"p",
"-",
"norm",
"or",
"the",
"induced",
"matrix",
"p",
"-",
"norm",
"depending",
"on",
"A",
"being",
"a",
"vector",
"or",
"a",
"matrix",
"respectively",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/NormOps_DDRM.java#L285-L298 |
162,361 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/NormOps_DDRM.java | NormOps_DDRM.normP1 | public static double normP1( DMatrixRMaj A ) {
if( MatrixFeatures_DDRM.isVector(A)) {
return CommonOps_DDRM.elementSumAbs(A);
} else {
return inducedP1(A);
}
} | java | public static double normP1( DMatrixRMaj A ) {
if( MatrixFeatures_DDRM.isVector(A)) {
return CommonOps_DDRM.elementSumAbs(A);
} else {
return inducedP1(A);
}
} | [
"public",
"static",
"double",
"normP1",
"(",
"DMatrixRMaj",
"A",
")",
"{",
"if",
"(",
"MatrixFeatures_DDRM",
".",
"isVector",
"(",
"A",
")",
")",
"{",
"return",
"CommonOps_DDRM",
".",
"elementSumAbs",
"(",
"A",
")",
";",
"}",
"else",
"{",
"return",
"indu... | Computes the p=1 norm. If A is a matrix then the induced norm is computed.
@param A Matrix or vector.
@return The norm. | [
"Computes",
"the",
"p",
"=",
"1",
"norm",
".",
"If",
"A",
"is",
"a",
"matrix",
"then",
"the",
"induced",
"norm",
"is",
"computed",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/NormOps_DDRM.java#L329-L335 |
162,362 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/NormOps_DDRM.java | NormOps_DDRM.normP2 | public static double normP2( DMatrixRMaj A ) {
if( MatrixFeatures_DDRM.isVector(A)) {
return normF(A);
} else {
return inducedP2(A);
}
} | java | public static double normP2( DMatrixRMaj A ) {
if( MatrixFeatures_DDRM.isVector(A)) {
return normF(A);
} else {
return inducedP2(A);
}
} | [
"public",
"static",
"double",
"normP2",
"(",
"DMatrixRMaj",
"A",
")",
"{",
"if",
"(",
"MatrixFeatures_DDRM",
".",
"isVector",
"(",
"A",
")",
")",
"{",
"return",
"normF",
"(",
"A",
")",
";",
"}",
"else",
"{",
"return",
"inducedP2",
"(",
"A",
")",
";",... | Computes the p=2 norm. If A is a matrix then the induced norm is computed.
@param A Matrix or vector.
@return The norm. | [
"Computes",
"the",
"p",
"=",
"2",
"norm",
".",
"If",
"A",
"is",
"a",
"matrix",
"then",
"the",
"induced",
"norm",
"is",
"computed",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/NormOps_DDRM.java#L343-L349 |
162,363 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/NormOps_DDRM.java | NormOps_DDRM.fastNormP2 | public static double fastNormP2( DMatrixRMaj A ) {
if( MatrixFeatures_DDRM.isVector(A)) {
return fastNormF(A);
} else {
return inducedP2(A);
}
} | java | public static double fastNormP2( DMatrixRMaj A ) {
if( MatrixFeatures_DDRM.isVector(A)) {
return fastNormF(A);
} else {
return inducedP2(A);
}
} | [
"public",
"static",
"double",
"fastNormP2",
"(",
"DMatrixRMaj",
"A",
")",
"{",
"if",
"(",
"MatrixFeatures_DDRM",
".",
"isVector",
"(",
"A",
")",
")",
"{",
"return",
"fastNormF",
"(",
"A",
")",
";",
"}",
"else",
"{",
"return",
"inducedP2",
"(",
"A",
")"... | Computes the p=2 norm. If A is a matrix then the induced norm is computed. This
implementation is faster, but more prone to buffer overflow or underflow problems.
@param A Matrix or vector.
@return The norm. | [
"Computes",
"the",
"p",
"=",
"2",
"norm",
".",
"If",
"A",
"is",
"a",
"matrix",
"then",
"the",
"induced",
"norm",
"is",
"computed",
".",
"This",
"implementation",
"is",
"faster",
"but",
"more",
"prone",
"to",
"buffer",
"overflow",
"or",
"underflow",
"prob... | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/NormOps_DDRM.java#L358-L364 |
162,364 | lessthanoptimal/ejml | main/ejml-core/src/org/ejml/ops/ReadCsv.java | ReadCsv.extractWords | protected List<String> extractWords() throws IOException
{
while( true ) {
lineNumber++;
String line = in.readLine();
if( line == null ) {
return null;
}
// skip comment lines
if( hasComment ) {
if( line... | java | protected List<String> extractWords() throws IOException
{
while( true ) {
lineNumber++;
String line = in.readLine();
if( line == null ) {
return null;
}
// skip comment lines
if( hasComment ) {
if( line... | [
"protected",
"List",
"<",
"String",
">",
"extractWords",
"(",
")",
"throws",
"IOException",
"{",
"while",
"(",
"true",
")",
"{",
"lineNumber",
"++",
";",
"String",
"line",
"=",
"in",
".",
"readLine",
"(",
")",
";",
"if",
"(",
"line",
"==",
"null",
")... | Finds the next valid line of words in the stream and extracts them.
@return List of valid words on the line. null if the end of the file has been reached.
@throws java.io.IOException | [
"Finds",
"the",
"next",
"valid",
"line",
"of",
"words",
"in",
"the",
"stream",
"and",
"extracts",
"them",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-core/src/org/ejml/ops/ReadCsv.java#L96-L114 |
162,365 | lessthanoptimal/ejml | main/ejml-core/src/org/ejml/ops/ReadCsv.java | ReadCsv.parseWords | protected List<String> parseWords(String line) {
List<String> words = new ArrayList<String>();
boolean insideWord = !isSpace(line.charAt(0));
int last = 0;
for( int i = 0; i < line.length(); i++) {
char c = line.charAt(i);
if( insideWord ) {
// se... | java | protected List<String> parseWords(String line) {
List<String> words = new ArrayList<String>();
boolean insideWord = !isSpace(line.charAt(0));
int last = 0;
for( int i = 0; i < line.length(); i++) {
char c = line.charAt(i);
if( insideWord ) {
// se... | [
"protected",
"List",
"<",
"String",
">",
"parseWords",
"(",
"String",
"line",
")",
"{",
"List",
"<",
"String",
">",
"words",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"boolean",
"insideWord",
"=",
"!",
"isSpace",
"(",
"line",
".",
"... | Extracts the words from a string. Words are seperated by a space character.
@param line The line that is being parsed.
@return A list of words contained on the line. | [
"Extracts",
"the",
"words",
"from",
"a",
"string",
".",
"Words",
"are",
"seperated",
"by",
"a",
"space",
"character",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-core/src/org/ejml/ops/ReadCsv.java#L122-L148 |
162,366 | lessthanoptimal/ejml | main/ejml-zdense/src/org/ejml/dense/row/decompose/qr/QrHelperFunctions_ZDRM.java | QrHelperFunctions_ZDRM.findMax | public static double findMax( double[] u, int startU , int length ) {
double max = -1;
int index = startU*2;
int stopIndex = (startU + length)*2;
for( ; index < stopIndex;) {
double real = u[index++];
double img = u[index++];
double val = real*real +... | java | public static double findMax( double[] u, int startU , int length ) {
double max = -1;
int index = startU*2;
int stopIndex = (startU + length)*2;
for( ; index < stopIndex;) {
double real = u[index++];
double img = u[index++];
double val = real*real +... | [
"public",
"static",
"double",
"findMax",
"(",
"double",
"[",
"]",
"u",
",",
"int",
"startU",
",",
"int",
"length",
")",
"{",
"double",
"max",
"=",
"-",
"1",
";",
"int",
"index",
"=",
"startU",
"*",
"2",
";",
"int",
"stopIndex",
"=",
"(",
"startU",
... | Returns the maximum magnitude of the complex numbers
@param u Array of complex numbers
@param startU first index to consider in u
@param length Number of complex numebrs to consider
@return magnitude | [
"Returns",
"the",
"maximum",
"magnitude",
"of",
"the",
"complex",
"numbers"
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/decompose/qr/QrHelperFunctions_ZDRM.java#L55-L72 |
162,367 | lessthanoptimal/ejml | main/ejml-zdense/src/org/ejml/dense/row/decompose/qr/QrHelperFunctions_ZDRM.java | QrHelperFunctions_ZDRM.extractHouseholderColumn | public static void extractHouseholderColumn( ZMatrixRMaj A ,
int row0 , int row1 ,
int col , double u[], int offsetU )
{
int indexU = (row0+offsetU)*2;
u[indexU++] = 1;
u[indexU++] = 0;
... | java | public static void extractHouseholderColumn( ZMatrixRMaj A ,
int row0 , int row1 ,
int col , double u[], int offsetU )
{
int indexU = (row0+offsetU)*2;
u[indexU++] = 1;
u[indexU++] = 0;
... | [
"public",
"static",
"void",
"extractHouseholderColumn",
"(",
"ZMatrixRMaj",
"A",
",",
"int",
"row0",
",",
"int",
"row1",
",",
"int",
"col",
",",
"double",
"u",
"[",
"]",
",",
"int",
"offsetU",
")",
"{",
"int",
"indexU",
"=",
"(",
"row0",
"+",
"offsetU"... | Extracts a house holder vector from the column of A and stores it in u
@param A Complex matrix with householder vectors stored in the lower left triangle
@param row0 first row in A (implicitly assumed to be r + i0)
@param row1 last row + 1 in A
@param col Column in A
@param u Output array storage
@param offsetU first i... | [
"Extracts",
"a",
"house",
"holder",
"vector",
"from",
"the",
"column",
"of",
"A",
"and",
"stores",
"it",
"in",
"u"
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/decompose/qr/QrHelperFunctions_ZDRM.java#L319-L332 |
162,368 | lessthanoptimal/ejml | main/ejml-zdense/src/org/ejml/dense/row/decompose/qr/QrHelperFunctions_ZDRM.java | QrHelperFunctions_ZDRM.extractHouseholderRow | public static void extractHouseholderRow( ZMatrixRMaj A ,
int row ,
int col0, int col1 , double u[], int offsetU )
{
int indexU = (offsetU+col0)*2;
u[indexU] = 1;
u[indexU+1] = 0;
int index... | java | public static void extractHouseholderRow( ZMatrixRMaj A ,
int row ,
int col0, int col1 , double u[], int offsetU )
{
int indexU = (offsetU+col0)*2;
u[indexU] = 1;
u[indexU+1] = 0;
int index... | [
"public",
"static",
"void",
"extractHouseholderRow",
"(",
"ZMatrixRMaj",
"A",
",",
"int",
"row",
",",
"int",
"col0",
",",
"int",
"col1",
",",
"double",
"u",
"[",
"]",
",",
"int",
"offsetU",
")",
"{",
"int",
"indexU",
"=",
"(",
"offsetU",
"+",
"col0",
... | Extracts a house holder vector from the rows of A and stores it in u
@param A Complex matrix with householder vectors stored in the upper right triangle
@param row Row in A
@param col0 first row in A (implicitly assumed to be r + i0)
@param col1 last row +1 in A
@param u Output array storage
@param offsetU first index ... | [
"Extracts",
"a",
"house",
"holder",
"vector",
"from",
"the",
"rows",
"of",
"A",
"and",
"stores",
"it",
"in",
"u"
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/decompose/qr/QrHelperFunctions_ZDRM.java#L343-L353 |
162,369 | lessthanoptimal/ejml | main/ejml-zdense/src/org/ejml/dense/row/decompose/qr/QrHelperFunctions_ZDRM.java | QrHelperFunctions_ZDRM.extractColumnAndMax | public static double extractColumnAndMax( ZMatrixRMaj A ,
int row0 , int row1 ,
int col , double u[], int offsetU) {
int indexU = (offsetU+row0)*2;
// find the largest value in this column
// this is use... | java | public static double extractColumnAndMax( ZMatrixRMaj A ,
int row0 , int row1 ,
int col , double u[], int offsetU) {
int indexU = (offsetU+row0)*2;
// find the largest value in this column
// this is use... | [
"public",
"static",
"double",
"extractColumnAndMax",
"(",
"ZMatrixRMaj",
"A",
",",
"int",
"row0",
",",
"int",
"row1",
",",
"int",
"col",
",",
"double",
"u",
"[",
"]",
",",
"int",
"offsetU",
")",
"{",
"int",
"indexU",
"=",
"(",
"offsetU",
"+",
"row0",
... | Extracts the column of A and copies it into u while computing the magnitude of the
largest element and returning it.
<pre>
u[ (offsetU+row0+i)*2 ] = A.getReal(row0+i,col)
u[ (offsetU+row0+i)*2 + 1] = A.getImag(row0+i,col)
</pre>
@param A Complex matrix
@param row0 First row in A to be copied
@param row1 Last row i... | [
"Extracts",
"the",
"column",
"of",
"A",
"and",
"copies",
"it",
"into",
"u",
"while",
"computing",
"the",
"magnitude",
"of",
"the",
"largest",
"element",
"and",
"returning",
"it",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/decompose/qr/QrHelperFunctions_ZDRM.java#L372-L396 |
162,370 | lessthanoptimal/ejml | main/ejml-zdense/src/org/ejml/dense/row/decompose/qr/QrHelperFunctions_ZDRM.java | QrHelperFunctions_ZDRM.computeRowMax | public static double computeRowMax( ZMatrixRMaj A ,
int row , int col0 , int col1 ) {
double max = 0;
int indexA = A.getIndex(row,col0);
double h[] = A.data;
for (int i = col0; i < col1; i++) {
double realVal = h[indexA++];
... | java | public static double computeRowMax( ZMatrixRMaj A ,
int row , int col0 , int col1 ) {
double max = 0;
int indexA = A.getIndex(row,col0);
double h[] = A.data;
for (int i = col0; i < col1; i++) {
double realVal = h[indexA++];
... | [
"public",
"static",
"double",
"computeRowMax",
"(",
"ZMatrixRMaj",
"A",
",",
"int",
"row",
",",
"int",
"col0",
",",
"int",
"col1",
")",
"{",
"double",
"max",
"=",
"0",
";",
"int",
"indexA",
"=",
"A",
".",
"getIndex",
"(",
"row",
",",
"col0",
")",
"... | Finds the magnitude of the largest element in the row
@param A Complex matrix
@param row Row in A
@param col0 First column in A to be copied
@param col1 Last column in A + 1 to be copied
@return magnitude of largest element | [
"Finds",
"the",
"magnitude",
"of",
"the",
"largest",
"element",
"in",
"the",
"row"
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/decompose/qr/QrHelperFunctions_ZDRM.java#L406-L423 |
162,371 | lessthanoptimal/ejml | main/ejml-zdense/src/org/ejml/dense/row/RandomMatrices_ZDRM.java | RandomMatrices_ZDRM.hermitian | public static ZMatrixRMaj hermitian(int length, double min, double max, Random rand) {
ZMatrixRMaj A = new ZMatrixRMaj(length,length);
fillHermitian(A, min, max, rand);
return A;
} | java | public static ZMatrixRMaj hermitian(int length, double min, double max, Random rand) {
ZMatrixRMaj A = new ZMatrixRMaj(length,length);
fillHermitian(A, min, max, rand);
return A;
} | [
"public",
"static",
"ZMatrixRMaj",
"hermitian",
"(",
"int",
"length",
",",
"double",
"min",
",",
"double",
"max",
",",
"Random",
"rand",
")",
"{",
"ZMatrixRMaj",
"A",
"=",
"new",
"ZMatrixRMaj",
"(",
"length",
",",
"length",
")",
";",
"fillHermitian",
"(",
... | Creates a random Hermitian matrix with elements from min to max value.
@param length Width and height of the matrix.
@param min Minimum value an element can have.
@param max Maximum value an element can have.
@param rand Random number generator.
@return A symmetric matrix. | [
"Creates",
"a",
"random",
"Hermitian",
"matrix",
"with",
"elements",
"from",
"min",
"to",
"max",
"value",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/RandomMatrices_ZDRM.java#L135-L141 |
162,372 | lessthanoptimal/ejml | main/ejml-zdense/src/org/ejml/dense/row/RandomMatrices_ZDRM.java | RandomMatrices_ZDRM.fillHermitian | public static void fillHermitian(ZMatrixRMaj A, double min, double max, Random rand) {
if( A.numRows != A.numCols )
throw new IllegalArgumentException("A must be a square matrix");
double range = max-min;
int length = A.numRows;
for( int i = 0; i < length; i++ ) {
... | java | public static void fillHermitian(ZMatrixRMaj A, double min, double max, Random rand) {
if( A.numRows != A.numCols )
throw new IllegalArgumentException("A must be a square matrix");
double range = max-min;
int length = A.numRows;
for( int i = 0; i < length; i++ ) {
... | [
"public",
"static",
"void",
"fillHermitian",
"(",
"ZMatrixRMaj",
"A",
",",
"double",
"min",
",",
"double",
"max",
",",
"Random",
"rand",
")",
"{",
"if",
"(",
"A",
".",
"numRows",
"!=",
"A",
".",
"numCols",
")",
"throw",
"new",
"IllegalArgumentException",
... | Assigns the provided square matrix to be a random Hermitian matrix with elements from min to max value.
@param A The matrix that is to be modified. Must be square. Modified.
@param min Minimum value an element can have.
@param max Maximum value an element can have.
@param rand Random number generator. | [
"Assigns",
"the",
"provided",
"square",
"matrix",
"to",
"be",
"a",
"random",
"Hermitian",
"matrix",
"with",
"elements",
"from",
"min",
"to",
"max",
"value",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/RandomMatrices_ZDRM.java#L151-L169 |
162,373 | lessthanoptimal/ejml | main/ejml-simple/src/org/ejml/simple/SimpleMatrix.java | SimpleMatrix.wrap | public static SimpleMatrix wrap( Matrix internalMat ) {
SimpleMatrix ret = new SimpleMatrix();
ret.setMatrix(internalMat);
return ret;
} | java | public static SimpleMatrix wrap( Matrix internalMat ) {
SimpleMatrix ret = new SimpleMatrix();
ret.setMatrix(internalMat);
return ret;
} | [
"public",
"static",
"SimpleMatrix",
"wrap",
"(",
"Matrix",
"internalMat",
")",
"{",
"SimpleMatrix",
"ret",
"=",
"new",
"SimpleMatrix",
"(",
")",
";",
"ret",
".",
"setMatrix",
"(",
"internalMat",
")",
";",
"return",
"ret",
";",
"}"
] | Creates a new SimpleMatrix with the specified DMatrixRMaj used as its internal matrix. This means
that the reference is saved and calls made to the returned SimpleMatrix will modify the passed in DMatrixRMaj.
@param internalMat The internal DMatrixRMaj of the returned SimpleMatrix. Will be modified. | [
"Creates",
"a",
"new",
"SimpleMatrix",
"with",
"the",
"specified",
"DMatrixRMaj",
"used",
"as",
"its",
"internal",
"matrix",
".",
"This",
"means",
"that",
"the",
"reference",
"is",
"saved",
"and",
"calls",
"made",
"to",
"the",
"returned",
"SimpleMatrix",
"will... | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-simple/src/org/ejml/simple/SimpleMatrix.java#L221-L225 |
162,374 | lessthanoptimal/ejml | main/ejml-simple/src/org/ejml/simple/SimpleMatrix.java | SimpleMatrix.diag | public static SimpleMatrix diag( Class type, double ...vals ) {
SimpleMatrix M = new SimpleMatrix(vals.length,vals.length,type);
for (int i = 0; i < vals.length; i++) {
M.set(i,i,vals[i]);
}
return M;
} | java | public static SimpleMatrix diag( Class type, double ...vals ) {
SimpleMatrix M = new SimpleMatrix(vals.length,vals.length,type);
for (int i = 0; i < vals.length; i++) {
M.set(i,i,vals[i]);
}
return M;
} | [
"public",
"static",
"SimpleMatrix",
"diag",
"(",
"Class",
"type",
",",
"double",
"...",
"vals",
")",
"{",
"SimpleMatrix",
"M",
"=",
"new",
"SimpleMatrix",
"(",
"vals",
".",
"length",
",",
"vals",
".",
"length",
",",
"type",
")",
";",
"for",
"(",
"int",... | Creates a real valued diagonal matrix of the specified type | [
"Creates",
"a",
"real",
"valued",
"diagonal",
"matrix",
"of",
"the",
"specified",
"type"
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-simple/src/org/ejml/simple/SimpleMatrix.java#L269-L275 |
162,375 | lessthanoptimal/ejml | main/ejml-zdense/src/org/ejml/dense/row/CommonOps_ZDRM.java | CommonOps_ZDRM.convert | public static void convert(DMatrixD1 input , ZMatrixD1 output ) {
if( input.numCols != output.numCols || input.numRows != output.numRows ) {
throw new IllegalArgumentException("The matrices are not all the same dimension.");
}
Arrays.fill(output.data, 0, output.getDataLength(), 0);
... | java | public static void convert(DMatrixD1 input , ZMatrixD1 output ) {
if( input.numCols != output.numCols || input.numRows != output.numRows ) {
throw new IllegalArgumentException("The matrices are not all the same dimension.");
}
Arrays.fill(output.data, 0, output.getDataLength(), 0);
... | [
"public",
"static",
"void",
"convert",
"(",
"DMatrixD1",
"input",
",",
"ZMatrixD1",
"output",
")",
"{",
"if",
"(",
"input",
".",
"numCols",
"!=",
"output",
".",
"numCols",
"||",
"input",
".",
"numRows",
"!=",
"output",
".",
"numRows",
")",
"{",
"throw",
... | Converts the real matrix into a complex matrix.
@param input Real matrix. Not modified.
@param output Complex matrix. Modified. | [
"Converts",
"the",
"real",
"matrix",
"into",
"a",
"complex",
"matrix",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/CommonOps_ZDRM.java#L144-L156 |
162,376 | lessthanoptimal/ejml | main/ejml-zdense/src/org/ejml/dense/row/CommonOps_ZDRM.java | CommonOps_ZDRM.stripReal | public static DMatrixRMaj stripReal(ZMatrixD1 input , DMatrixRMaj output ) {
if( output == null ) {
output = new DMatrixRMaj(input.numRows,input.numCols);
} else if( input.numCols != output.numCols || input.numRows != output.numRows ) {
throw new IllegalArgumentException("The mat... | java | public static DMatrixRMaj stripReal(ZMatrixD1 input , DMatrixRMaj output ) {
if( output == null ) {
output = new DMatrixRMaj(input.numRows,input.numCols);
} else if( input.numCols != output.numCols || input.numRows != output.numRows ) {
throw new IllegalArgumentException("The mat... | [
"public",
"static",
"DMatrixRMaj",
"stripReal",
"(",
"ZMatrixD1",
"input",
",",
"DMatrixRMaj",
"output",
")",
"{",
"if",
"(",
"output",
"==",
"null",
")",
"{",
"output",
"=",
"new",
"DMatrixRMaj",
"(",
"input",
".",
"numRows",
",",
"input",
".",
"numCols",... | Places the real component of the input matrix into the output matrix.
@param input Complex matrix. Not modified.
@param output real matrix. Modified. | [
"Places",
"the",
"real",
"component",
"of",
"the",
"input",
"matrix",
"into",
"the",
"output",
"matrix",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/CommonOps_ZDRM.java#L164-L177 |
162,377 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/block/MatrixOps_DDRB.java | MatrixOps_DDRB.convert | public static DMatrixRMaj convert(DMatrixRBlock src , DMatrixRMaj dst )
{
return ConvertDMatrixStruct.convert(src,dst);
} | java | public static DMatrixRMaj convert(DMatrixRBlock src , DMatrixRMaj dst )
{
return ConvertDMatrixStruct.convert(src,dst);
} | [
"public",
"static",
"DMatrixRMaj",
"convert",
"(",
"DMatrixRBlock",
"src",
",",
"DMatrixRMaj",
"dst",
")",
"{",
"return",
"ConvertDMatrixStruct",
".",
"convert",
"(",
"src",
",",
"dst",
")",
";",
"}"
] | Converts a row major block matrix into a row major matrix.
@param src Original DMatrixRBlock.. Not modified.
@param dst Equivalent DMatrixRMaj. Modified. | [
"Converts",
"a",
"row",
"major",
"block",
"matrix",
"into",
"a",
"row",
"major",
"matrix",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/block/MatrixOps_DDRB.java#L96-L99 |
162,378 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/block/MatrixOps_DDRB.java | MatrixOps_DDRB.convertTranSrc | public static void convertTranSrc(DMatrixRMaj src , DMatrixRBlock dst )
{
if( src.numRows != dst.numCols || src.numCols != dst.numRows )
throw new IllegalArgumentException("Incompatible matrix shapes.");
for( int i = 0; i < dst.numRows; i += dst.blockLength ) {
int blockHeig... | java | public static void convertTranSrc(DMatrixRMaj src , DMatrixRBlock dst )
{
if( src.numRows != dst.numCols || src.numCols != dst.numRows )
throw new IllegalArgumentException("Incompatible matrix shapes.");
for( int i = 0; i < dst.numRows; i += dst.blockLength ) {
int blockHeig... | [
"public",
"static",
"void",
"convertTranSrc",
"(",
"DMatrixRMaj",
"src",
",",
"DMatrixRBlock",
"dst",
")",
"{",
"if",
"(",
"src",
".",
"numRows",
"!=",
"dst",
".",
"numCols",
"||",
"src",
".",
"numCols",
"!=",
"dst",
".",
"numRows",
")",
"throw",
"new",
... | Converts the transpose of a row major matrix into a row major block matrix.
@param src Original DMatrixRMaj. Not modified.
@param dst Equivalent DMatrixRBlock. Modified. | [
"Converts",
"the",
"transpose",
"of",
"a",
"row",
"major",
"matrix",
"into",
"a",
"row",
"major",
"block",
"matrix",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/block/MatrixOps_DDRB.java#L146-L169 |
162,379 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/block/MatrixOps_DDRB.java | MatrixOps_DDRB.transpose | public static DMatrixRBlock transpose(DMatrixRBlock A , DMatrixRBlock A_tran )
{
if( A_tran != null ) {
if( A.numRows != A_tran.numCols || A.numCols != A_tran.numRows )
throw new IllegalArgumentException("Incompatible dimensions.");
if( A.blockLength != A_tran.blockLe... | java | public static DMatrixRBlock transpose(DMatrixRBlock A , DMatrixRBlock A_tran )
{
if( A_tran != null ) {
if( A.numRows != A_tran.numCols || A.numCols != A_tran.numRows )
throw new IllegalArgumentException("Incompatible dimensions.");
if( A.blockLength != A_tran.blockLe... | [
"public",
"static",
"DMatrixRBlock",
"transpose",
"(",
"DMatrixRBlock",
"A",
",",
"DMatrixRBlock",
"A_tran",
")",
"{",
"if",
"(",
"A_tran",
"!=",
"null",
")",
"{",
"if",
"(",
"A",
".",
"numRows",
"!=",
"A_tran",
".",
"numCols",
"||",
"A",
".",
"numCols",... | Transposes a block matrix.
@param A Original matrix. Not modified.
@param A_tran Transposed matrix. Modified. | [
"Transposes",
"a",
"block",
"matrix",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/block/MatrixOps_DDRB.java#L239-L265 |
162,380 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/block/MatrixOps_DDRB.java | MatrixOps_DDRB.transposeBlock | private static void transposeBlock(DMatrixRBlock A , DMatrixRBlock A_tran,
int indexA , int indexC ,
int width , int height )
{
for( int i = 0; i < height; i++ ) {
int rowIndexC = indexC + i;
int rowIndexA ... | java | private static void transposeBlock(DMatrixRBlock A , DMatrixRBlock A_tran,
int indexA , int indexC ,
int width , int height )
{
for( int i = 0; i < height; i++ ) {
int rowIndexC = indexC + i;
int rowIndexA ... | [
"private",
"static",
"void",
"transposeBlock",
"(",
"DMatrixRBlock",
"A",
",",
"DMatrixRBlock",
"A_tran",
",",
"int",
"indexA",
",",
"int",
"indexC",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
... | Transposes an individual block inside a block matrix. | [
"Transposes",
"an",
"individual",
"block",
"inside",
"a",
"block",
"matrix",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/block/MatrixOps_DDRB.java#L270-L282 |
162,381 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/block/MatrixOps_DDRB.java | MatrixOps_DDRB.zeroTriangle | public static void zeroTriangle( boolean upper , DMatrixRBlock A )
{
int blockLength = A.blockLength;
if( upper ) {
for( int i = 0; i < A.numRows; i += blockLength ) {
int h = Math.min(blockLength,A.numRows-i);
for( int j = i; j < A.numCols; j += blockLe... | java | public static void zeroTriangle( boolean upper , DMatrixRBlock A )
{
int blockLength = A.blockLength;
if( upper ) {
for( int i = 0; i < A.numRows; i += blockLength ) {
int h = Math.min(blockLength,A.numRows-i);
for( int j = i; j < A.numCols; j += blockLe... | [
"public",
"static",
"void",
"zeroTriangle",
"(",
"boolean",
"upper",
",",
"DMatrixRBlock",
"A",
")",
"{",
"int",
"blockLength",
"=",
"A",
".",
"blockLength",
";",
"if",
"(",
"upper",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"A",
"... | Sets either the upper or low triangle of a matrix to zero | [
"Sets",
"either",
"the",
"upper",
"or",
"low",
"triangle",
"of",
"a",
"matrix",
"to",
"zero"
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/block/MatrixOps_DDRB.java#L337-L391 |
162,382 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/block/MatrixOps_DDRB.java | MatrixOps_DDRB.blockAligned | public static boolean blockAligned( int blockLength , DSubmatrixD1 A ) {
if( A.col0 % blockLength != 0 )
return false;
if( A.row0 % blockLength != 0 )
return false;
if( A.col1 % blockLength != 0 && A.col1 != A.original.numCols ) {
return false;
}
... | java | public static boolean blockAligned( int blockLength , DSubmatrixD1 A ) {
if( A.col0 % blockLength != 0 )
return false;
if( A.row0 % blockLength != 0 )
return false;
if( A.col1 % blockLength != 0 && A.col1 != A.original.numCols ) {
return false;
}
... | [
"public",
"static",
"boolean",
"blockAligned",
"(",
"int",
"blockLength",
",",
"DSubmatrixD1",
"A",
")",
"{",
"if",
"(",
"A",
".",
"col0",
"%",
"blockLength",
"!=",
"0",
")",
"return",
"false",
";",
"if",
"(",
"A",
".",
"row0",
"%",
"blockLength",
"!="... | Checks to see if the submatrix has its boundaries along inner blocks.
@param blockLength Size of an inner block.
@param A Submatrix.
@return If it is block aligned or not. | [
"Checks",
"to",
"see",
"if",
"the",
"submatrix",
"has",
"its",
"boundaries",
"along",
"inner",
"blocks",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/block/MatrixOps_DDRB.java#L604-L619 |
162,383 | lessthanoptimal/ejml | main/ejml-experimental/src/org/ejml/dense/row/decomposition/svd/SvdImplicitQrDecompose_Ultimate.java | SvdImplicitQrDecompose_Ultimate.makeSingularPositive | private void makeSingularPositive() {
numSingular = qralg.getNumberOfSingularValues();
singularValues = qralg.getSingularValues();
for( int i = 0; i < numSingular; i++ ) {
double val = singularValues[i];
if( val < 0 ) {
singularValues[i] = -val;
... | java | private void makeSingularPositive() {
numSingular = qralg.getNumberOfSingularValues();
singularValues = qralg.getSingularValues();
for( int i = 0; i < numSingular; i++ ) {
double val = singularValues[i];
if( val < 0 ) {
singularValues[i] = -val;
... | [
"private",
"void",
"makeSingularPositive",
"(",
")",
"{",
"numSingular",
"=",
"qralg",
".",
"getNumberOfSingularValues",
"(",
")",
";",
"singularValues",
"=",
"qralg",
".",
"getSingularValues",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<"... | With the QR algorithm it is possible for the found singular values to be native. This
makes them all positive by multiplying it by a diagonal matrix that has | [
"With",
"the",
"QR",
"algorithm",
"it",
"is",
"possible",
"for",
"the",
"found",
"singular",
"values",
"to",
"be",
"native",
".",
"This",
"makes",
"them",
"all",
"positive",
"by",
"multiplying",
"it",
"by",
"a",
"diagonal",
"matrix",
"that",
"has"
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-experimental/src/org/ejml/dense/row/decomposition/svd/SvdImplicitQrDecompose_Ultimate.java#L279-L301 |
162,384 | lessthanoptimal/ejml | examples/src/org/ejml/example/PolynomialFit.java | PolynomialFit.fit | public void fit( double samplePoints[] , double[] observations ) {
// Create a copy of the observations and put it into a matrix
y.reshape(observations.length,1,false);
System.arraycopy(observations,0, y.data,0,observations.length);
// reshape the matrix to avoid unnecessarily declaring... | java | public void fit( double samplePoints[] , double[] observations ) {
// Create a copy of the observations and put it into a matrix
y.reshape(observations.length,1,false);
System.arraycopy(observations,0, y.data,0,observations.length);
// reshape the matrix to avoid unnecessarily declaring... | [
"public",
"void",
"fit",
"(",
"double",
"samplePoints",
"[",
"]",
",",
"double",
"[",
"]",
"observations",
")",
"{",
"// Create a copy of the observations and put it into a matrix",
"y",
".",
"reshape",
"(",
"observations",
".",
"length",
",",
"1",
",",
"false",
... | Computes the best fit set of polynomial coefficients to the provided observations.
@param samplePoints where the observations were sampled.
@param observations A set of observations. | [
"Computes",
"the",
"best",
"fit",
"set",
"of",
"polynomial",
"coefficients",
"to",
"the",
"provided",
"observations",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/examples/src/org/ejml/example/PolynomialFit.java#L82-L108 |
162,385 | lessthanoptimal/ejml | examples/src/org/ejml/example/PolynomialFit.java | PolynomialFit.removeWorstFit | public void removeWorstFit() {
// find the observation with the most error
int worstIndex=-1;
double worstError = -1;
for( int i = 0; i < y.numRows; i++ ) {
double predictedObs = 0;
for( int j = 0; j < coef.numRows; j++ ) {
predictedObs += A.get(... | java | public void removeWorstFit() {
// find the observation with the most error
int worstIndex=-1;
double worstError = -1;
for( int i = 0; i < y.numRows; i++ ) {
double predictedObs = 0;
for( int j = 0; j < coef.numRows; j++ ) {
predictedObs += A.get(... | [
"public",
"void",
"removeWorstFit",
"(",
")",
"{",
"// find the observation with the most error",
"int",
"worstIndex",
"=",
"-",
"1",
";",
"double",
"worstError",
"=",
"-",
"1",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"y",
".",
"numRows",
"... | Removes the observation that fits the model the worst and recomputes the coefficients.
This is done efficiently by using an adjustable solver. Often times the elements with
the largest errors are outliers and not part of the system being modeled. By removing them
a more accurate set of coefficients can be computed. | [
"Removes",
"the",
"observation",
"that",
"fits",
"the",
"model",
"the",
"worst",
"and",
"recomputes",
"the",
"coefficients",
".",
"This",
"is",
"done",
"efficiently",
"by",
"using",
"an",
"adjustable",
"solver",
".",
"Often",
"times",
"the",
"elements",
"with"... | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/examples/src/org/ejml/example/PolynomialFit.java#L116-L148 |
162,386 | lessthanoptimal/ejml | examples/src/org/ejml/example/PolynomialFit.java | PolynomialFit.removeObservation | private void removeObservation( int index ) {
final int N = y.numRows-1;
final double d[] = y.data;
// shift
for( int i = index; i < N; i++ ) {
d[i] = d[i+1];
}
y.numRows--;
} | java | private void removeObservation( int index ) {
final int N = y.numRows-1;
final double d[] = y.data;
// shift
for( int i = index; i < N; i++ ) {
d[i] = d[i+1];
}
y.numRows--;
} | [
"private",
"void",
"removeObservation",
"(",
"int",
"index",
")",
"{",
"final",
"int",
"N",
"=",
"y",
".",
"numRows",
"-",
"1",
";",
"final",
"double",
"d",
"[",
"]",
"=",
"y",
".",
"data",
";",
"// shift",
"for",
"(",
"int",
"i",
"=",
"index",
"... | Removes an element from the observation matrix.
@param index which element is to be removed | [
"Removes",
"an",
"element",
"from",
"the",
"observation",
"matrix",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/examples/src/org/ejml/example/PolynomialFit.java#L155-L164 |
162,387 | lessthanoptimal/ejml | main/ejml-zdense/src/org/ejml/dense/row/SpecializedOps_ZDRM.java | SpecializedOps_ZDRM.householderVector | public static ZMatrixRMaj householderVector(ZMatrixRMaj x ) {
ZMatrixRMaj u = x.copy();
double max = CommonOps_ZDRM.elementMaxAbs(u);
CommonOps_ZDRM.elementDivide(u, max, 0, u);
double nx = NormOps_ZDRM.normF(u);
Complex_F64 c = new Complex_F64();
u.get(0,0,c);
... | java | public static ZMatrixRMaj householderVector(ZMatrixRMaj x ) {
ZMatrixRMaj u = x.copy();
double max = CommonOps_ZDRM.elementMaxAbs(u);
CommonOps_ZDRM.elementDivide(u, max, 0, u);
double nx = NormOps_ZDRM.normF(u);
Complex_F64 c = new Complex_F64();
u.get(0,0,c);
... | [
"public",
"static",
"ZMatrixRMaj",
"householderVector",
"(",
"ZMatrixRMaj",
"x",
")",
"{",
"ZMatrixRMaj",
"u",
"=",
"x",
".",
"copy",
"(",
")",
";",
"double",
"max",
"=",
"CommonOps_ZDRM",
".",
"elementMaxAbs",
"(",
"u",
")",
";",
"CommonOps_ZDRM",
".",
"e... | Computes the householder vector used in QR decomposition.
u = x / max(x)
u(0) = u(0) + |u|
u = u / u(0)
@param x Input vector. Unmodified.
@return The found householder reflector vector | [
"Computes",
"the",
"householder",
"vector",
"used",
"in",
"QR",
"decomposition",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/SpecializedOps_ZDRM.java#L217-L242 |
162,388 | lessthanoptimal/ejml | main/ejml-zdense/src/org/ejml/dense/row/decompose/hessenberg/HessenbergSimilarDecomposition_ZDRM.java | HessenbergSimilarDecomposition_ZDRM.decompose | @Override
public boolean decompose( ZMatrixRMaj A )
{
if( A.numRows != A.numCols )
throw new IllegalArgumentException("A must be square.");
if( A.numRows <= 0 )
return false;
QH = A;
N = A.numCols;
if( b.length < N*2 ) {
b = new doub... | java | @Override
public boolean decompose( ZMatrixRMaj A )
{
if( A.numRows != A.numCols )
throw new IllegalArgumentException("A must be square.");
if( A.numRows <= 0 )
return false;
QH = A;
N = A.numCols;
if( b.length < N*2 ) {
b = new doub... | [
"@",
"Override",
"public",
"boolean",
"decompose",
"(",
"ZMatrixRMaj",
"A",
")",
"{",
"if",
"(",
"A",
".",
"numRows",
"!=",
"A",
".",
"numCols",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"A must be square.\"",
")",
";",
"if",
"(",
"A",
".",
... | Computes the decomposition of the provided matrix. If no errors are detected then true is returned,
false otherwise.
@param A The matrix that is being decomposed. Not modified.
@return If it detects any errors or not. | [
"Computes",
"the",
"decomposition",
"of",
"the",
"provided",
"matrix",
".",
"If",
"no",
"errors",
"are",
"detected",
"then",
"true",
"is",
"returned",
"false",
"otherwise",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/decompose/hessenberg/HessenbergSimilarDecomposition_ZDRM.java#L86-L104 |
162,389 | lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/linsol/qr/AdjLinearSolverQr_DDRM.java | AdjLinearSolverQr_DDRM.getA | @Override
public DMatrixRMaj getA() {
if( A.data.length < numRows*numCols ) {
A = new DMatrixRMaj(numRows,numCols);
}
A.reshape(numRows,numCols, false);
CommonOps_DDRM.mult(Q,R,A);
return A;
} | java | @Override
public DMatrixRMaj getA() {
if( A.data.length < numRows*numCols ) {
A = new DMatrixRMaj(numRows,numCols);
}
A.reshape(numRows,numCols, false);
CommonOps_DDRM.mult(Q,R,A);
return A;
} | [
"@",
"Override",
"public",
"DMatrixRMaj",
"getA",
"(",
")",
"{",
"if",
"(",
"A",
".",
"data",
".",
"length",
"<",
"numRows",
"*",
"numCols",
")",
"{",
"A",
"=",
"new",
"DMatrixRMaj",
"(",
"numRows",
",",
"numCols",
")",
";",
"}",
"A",
".",
"reshape... | Compute the A matrix from the Q and R matrices.
@return The A matrix. | [
"Compute",
"the",
"A",
"matrix",
"from",
"the",
"Q",
"and",
"R",
"matrices",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/linsol/qr/AdjLinearSolverQr_DDRM.java#L60-L69 |
162,390 | lessthanoptimal/ejml | main/ejml-simple/src/org/ejml/simple/SimpleBase.java | SimpleBase.set | public void set( T a ) {
if( a.getType() == getType() )
mat.set(a.getMatrix());
else {
setMatrix(a.mat.copy());
}
} | java | public void set( T a ) {
if( a.getType() == getType() )
mat.set(a.getMatrix());
else {
setMatrix(a.mat.copy());
}
} | [
"public",
"void",
"set",
"(",
"T",
"a",
")",
"{",
"if",
"(",
"a",
".",
"getType",
"(",
")",
"==",
"getType",
"(",
")",
")",
"mat",
".",
"set",
"(",
"a",
".",
"getMatrix",
"(",
")",
")",
";",
"else",
"{",
"setMatrix",
"(",
"a",
".",
"mat",
"... | Sets the elements in this matrix to be equal to the elements in the passed in matrix.
Both matrix must have the same dimension.
@param a The matrix whose value this matrix is being set to. | [
"Sets",
"the",
"elements",
"in",
"this",
"matrix",
"to",
"be",
"equal",
"to",
"the",
"elements",
"in",
"the",
"passed",
"in",
"matrix",
".",
"Both",
"matrix",
"must",
"have",
"the",
"same",
"dimension",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-simple/src/org/ejml/simple/SimpleBase.java#L489-L495 |
162,391 | lessthanoptimal/ejml | main/ejml-simple/src/org/ejml/simple/SimpleBase.java | SimpleBase.set | public void set( int row , int col , double value ) {
ops.set(mat, row, col, value);
} | java | public void set( int row , int col , double value ) {
ops.set(mat, row, col, value);
} | [
"public",
"void",
"set",
"(",
"int",
"row",
",",
"int",
"col",
",",
"double",
"value",
")",
"{",
"ops",
".",
"set",
"(",
"mat",
",",
"row",
",",
"col",
",",
"value",
")",
";",
"}"
] | Assigns the element in the Matrix to the specified value. Performs a bounds check to make sure
the requested element is part of the matrix.
@param row The row of the element.
@param col The column of the element.
@param value The element's new value. | [
"Assigns",
"the",
"element",
"in",
"the",
"Matrix",
"to",
"the",
"specified",
"value",
".",
"Performs",
"a",
"bounds",
"check",
"to",
"make",
"sure",
"the",
"requested",
"element",
"is",
"part",
"of",
"the",
"matrix",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-simple/src/org/ejml/simple/SimpleBase.java#L615-L617 |
162,392 | lessthanoptimal/ejml | main/ejml-simple/src/org/ejml/simple/SimpleBase.java | SimpleBase.set | public void set( int index , double value ) {
if( mat.getType() == MatrixType.DDRM ) {
((DMatrixRMaj) mat).set(index, value);
} else if( mat.getType() == MatrixType.FDRM ) {
((FMatrixRMaj) mat).set(index, (float)value);
} else {
throw new RuntimeException("Not... | java | public void set( int index , double value ) {
if( mat.getType() == MatrixType.DDRM ) {
((DMatrixRMaj) mat).set(index, value);
} else if( mat.getType() == MatrixType.FDRM ) {
((FMatrixRMaj) mat).set(index, (float)value);
} else {
throw new RuntimeException("Not... | [
"public",
"void",
"set",
"(",
"int",
"index",
",",
"double",
"value",
")",
"{",
"if",
"(",
"mat",
".",
"getType",
"(",
")",
"==",
"MatrixType",
".",
"DDRM",
")",
"{",
"(",
"(",
"DMatrixRMaj",
")",
"mat",
")",
".",
"set",
"(",
"index",
",",
"value... | Assigns an element a value based on its index in the internal array..
@param index The matrix element that is being assigned a value.
@param value The element's new value. | [
"Assigns",
"an",
"element",
"a",
"value",
"based",
"on",
"its",
"index",
"in",
"the",
"internal",
"array",
".."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-simple/src/org/ejml/simple/SimpleBase.java#L625-L633 |
162,393 | lessthanoptimal/ejml | main/ejml-simple/src/org/ejml/simple/SimpleBase.java | SimpleBase.set | public void set( int row , int col , double real , double imaginary ) {
if( imaginary == 0 ) {
set(row,col,real);
} else {
ops.set(mat,row,col, real, imaginary);
}
} | java | public void set( int row , int col , double real , double imaginary ) {
if( imaginary == 0 ) {
set(row,col,real);
} else {
ops.set(mat,row,col, real, imaginary);
}
} | [
"public",
"void",
"set",
"(",
"int",
"row",
",",
"int",
"col",
",",
"double",
"real",
",",
"double",
"imaginary",
")",
"{",
"if",
"(",
"imaginary",
"==",
"0",
")",
"{",
"set",
"(",
"row",
",",
"col",
",",
"real",
")",
";",
"}",
"else",
"{",
"op... | Used to set the complex value of a matrix element.
@param row The row of the element.
@param col The column of the element.
@param real Real component of assigned value
@param imaginary Imaginary component of assigned value | [
"Used",
"to",
"set",
"the",
"complex",
"value",
"of",
"a",
"matrix",
"element",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-simple/src/org/ejml/simple/SimpleBase.java#L642-L648 |
162,394 | lessthanoptimal/ejml | main/ejml-simple/src/org/ejml/simple/SimpleBase.java | SimpleBase.get | public double get( int index ) {
MatrixType type = mat.getType();
if( type.isReal()) {
if (type.getBits() == 64) {
return ((DMatrixRMaj) mat).data[index];
} else {
return ((FMatrixRMaj) mat).data[index];
}
} else {
... | java | public double get( int index ) {
MatrixType type = mat.getType();
if( type.isReal()) {
if (type.getBits() == 64) {
return ((DMatrixRMaj) mat).data[index];
} else {
return ((FMatrixRMaj) mat).data[index];
}
} else {
... | [
"public",
"double",
"get",
"(",
"int",
"index",
")",
"{",
"MatrixType",
"type",
"=",
"mat",
".",
"getType",
"(",
")",
";",
"if",
"(",
"type",
".",
"isReal",
"(",
")",
")",
"{",
"if",
"(",
"type",
".",
"getBits",
"(",
")",
"==",
"64",
")",
"{",
... | Returns the value of the matrix at the specified index of the 1D row major array.
@see DMatrixRMaj#get(int)
@param index The element's index whose value is to be returned
@return The value of the specified element. | [
"Returns",
"the",
"value",
"of",
"the",
"matrix",
"at",
"the",
"specified",
"index",
"of",
"the",
"1D",
"row",
"major",
"array",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-simple/src/org/ejml/simple/SimpleBase.java#L702-L714 |
162,395 | lessthanoptimal/ejml | main/ejml-simple/src/org/ejml/simple/SimpleBase.java | SimpleBase.get | public void get( int row , int col , Complex_F64 output ) {
ops.get(mat,row,col,output);
} | java | public void get( int row , int col , Complex_F64 output ) {
ops.get(mat,row,col,output);
} | [
"public",
"void",
"get",
"(",
"int",
"row",
",",
"int",
"col",
",",
"Complex_F64",
"output",
")",
"{",
"ops",
".",
"get",
"(",
"mat",
",",
"row",
",",
"col",
",",
"output",
")",
";",
"}"
] | Used to get the complex value of a matrix element.
@param row The row of the element.
@param col The column of the element.
@param output Storage for the value | [
"Used",
"to",
"get",
"the",
"complex",
"value",
"of",
"a",
"matrix",
"element",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-simple/src/org/ejml/simple/SimpleBase.java#L722-L724 |
162,396 | lessthanoptimal/ejml | main/ejml-simple/src/org/ejml/simple/SimpleBase.java | SimpleBase.copy | public T copy() {
T ret = createLike();
ret.getMatrix().set(this.getMatrix());
return ret;
} | java | public T copy() {
T ret = createLike();
ret.getMatrix().set(this.getMatrix());
return ret;
} | [
"public",
"T",
"copy",
"(",
")",
"{",
"T",
"ret",
"=",
"createLike",
"(",
")",
";",
"ret",
".",
"getMatrix",
"(",
")",
".",
"set",
"(",
"this",
".",
"getMatrix",
"(",
")",
")",
";",
"return",
"ret",
";",
"}"
] | Creates and returns a matrix which is idential to this one.
@return A new identical matrix. | [
"Creates",
"and",
"returns",
"a",
"matrix",
"which",
"is",
"idential",
"to",
"this",
"one",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-simple/src/org/ejml/simple/SimpleBase.java#L761-L765 |
162,397 | lessthanoptimal/ejml | main/ejml-simple/src/org/ejml/simple/SimpleBase.java | SimpleBase.isIdentical | public boolean isIdentical(T a, double tol) {
if( a.getType() != getType() )
return false;
return ops.isIdentical(mat,a.mat,tol);
} | java | public boolean isIdentical(T a, double tol) {
if( a.getType() != getType() )
return false;
return ops.isIdentical(mat,a.mat,tol);
} | [
"public",
"boolean",
"isIdentical",
"(",
"T",
"a",
",",
"double",
"tol",
")",
"{",
"if",
"(",
"a",
".",
"getType",
"(",
")",
"!=",
"getType",
"(",
")",
")",
"return",
"false",
";",
"return",
"ops",
".",
"isIdentical",
"(",
"mat",
",",
"a",
".",
"... | Checks to see if matrix 'a' is the same as this matrix within the specified
tolerance.
@param a The matrix it is being compared against.
@param tol How similar they must be to be equals.
@return If they are equal within tolerance of each other. | [
"Checks",
"to",
"see",
"if",
"matrix",
"a",
"is",
"the",
"same",
"as",
"this",
"matrix",
"within",
"the",
"specified",
"tolerance",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-simple/src/org/ejml/simple/SimpleBase.java#L904-L908 |
162,398 | lessthanoptimal/ejml | main/ejml-simple/src/org/ejml/simple/SimpleBase.java | SimpleBase.isInBounds | public boolean isInBounds(int row, int col) {
return row >= 0 && col >= 0 && row < mat.getNumRows() && col < mat.getNumCols();
} | java | public boolean isInBounds(int row, int col) {
return row >= 0 && col >= 0 && row < mat.getNumRows() && col < mat.getNumCols();
} | [
"public",
"boolean",
"isInBounds",
"(",
"int",
"row",
",",
"int",
"col",
")",
"{",
"return",
"row",
">=",
"0",
"&&",
"col",
">=",
"0",
"&&",
"row",
"<",
"mat",
".",
"getNumRows",
"(",
")",
"&&",
"col",
"<",
"mat",
".",
"getNumCols",
"(",
")",
";"... | Returns true of the specified matrix element is valid element inside this matrix.
@param row Row index.
@param col Column index.
@return true if it is a valid element in the matrix. | [
"Returns",
"true",
"of",
"the",
"specified",
"matrix",
"element",
"is",
"valid",
"element",
"inside",
"this",
"matrix",
"."
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-simple/src/org/ejml/simple/SimpleBase.java#L1331-L1333 |
162,399 | lessthanoptimal/ejml | main/ejml-simple/src/org/ejml/simple/SimpleBase.java | SimpleBase.convertToSparse | public void convertToSparse() {
switch ( mat.getType() ) {
case DDRM: {
DMatrixSparseCSC m = new DMatrixSparseCSC(mat.getNumRows(), mat.getNumCols());
ConvertDMatrixStruct.convert((DMatrixRMaj) mat, m,0);
setMatrix(m);
} break;
... | java | public void convertToSparse() {
switch ( mat.getType() ) {
case DDRM: {
DMatrixSparseCSC m = new DMatrixSparseCSC(mat.getNumRows(), mat.getNumCols());
ConvertDMatrixStruct.convert((DMatrixRMaj) mat, m,0);
setMatrix(m);
} break;
... | [
"public",
"void",
"convertToSparse",
"(",
")",
"{",
"switch",
"(",
"mat",
".",
"getType",
"(",
")",
")",
"{",
"case",
"DDRM",
":",
"{",
"DMatrixSparseCSC",
"m",
"=",
"new",
"DMatrixSparseCSC",
"(",
"mat",
".",
"getNumRows",
"(",
")",
",",
"mat",
".",
... | Switches from a dense to sparse matrix | [
"Switches",
"from",
"a",
"dense",
"to",
"sparse",
"matrix"
] | 1444680cc487af5e866730e62f48f5f9636850d9 | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-simple/src/org/ejml/simple/SimpleBase.java#L1501-L1520 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.