| CS 371 - Introduction to Artificial Intelligence
Homework #1 |
0. Reading, Starter Code, Peg Solitaire, and the Buckets Problem: Read R&N Chapter 3 through section 3.4.5. Download and study the supplied starter code (documentation). Read more about the Peg Solitaire and Buckets problems here. Give special attention to the implementation of PegSolitaireNode and BucketsNode, as these will serve as models for a SearchNode you will extend later.
1. Breadth-First Search: Complete the implementation of the Breadth-First Search (BFS) class BreadthFirstSearcher by filling in code after the given comments (in-class). Node children should enter the queue in the same order that they appear in the list returned by the expand method. With this and other search algorithms to come, test your implementation with both PegSolitaireNode and BucketsNode by uncommenting the appropriate lines in SearchTest.
2. Depth-First Search: Complete the implementation of the Depth-First Search (DFS) class DepthFirstSearcher by filling in code after the given comments (in-class). Node children should be pushed onto the stack in the same order that they appear in the list returned by the expand method.
3. Depth-Limited Search: Implement Depth-Limited Search (DLS) class DepthLimitedSearcher by modifying your DepthFirstSearcher to take an integer depth limit as the single contructor parameter, and not expanding/pushing nodes beyond the depth limit.
4. Iterative-Deepening Depth-First Search: Implement Iterative-Deepening Depth-First Search (IDDFS) class IterativeDeepeningDepthFirstSearcher by creating a new Searcher class extension that performs depth-limited searches to depth limits 1, 2, 3, etc. until successful. Remember that the node count of this Searcher is the sum of the node counts of all depth-limited searches performed.
5. Recursive Depth-First Search: In many applications of depth-first search, it is simpler to express it as a recursive algorithm. (Using a different model of a search node, this permits one to make/undo state changes easily.) Implement Search class extension RecursiveDepthFirstSearcher that performs a recursive depth-first search of each child in the order that they appear in the list returned by the expand method. Note that this implementation effectively visits a node's children in the reverse order that they would be visited in the iterative stack-based implementation of DepthFirstSearcher.
6. Designing a Reverse-Perfect-Shuffle Magic Trick: Implement class ReversePerfectShuffleNode according to this specification. Read the comments with great care to understand the specification of each Searcher method. In addition, you will add a main method that prints the results of a search, revealing the means to perform a card magic trick of my design.
ReversePerfectShuffleNode is a class modeling perfect reverse (a.k.a. anti-faro) in- and out-shuffles in order to find a means of working the four top cards into the 5th, 10th, 15th, and 20th positions. A perfect shuffle is one where the deck is cut perfectly in half and then "riffled" together alternating one card from each half like the teeth of a zipper before being pushed together. This is considered to be one of the most difficult sleights of hand in card magic, and it allows the performer to control the positions of all cards in the deck, rearranging the permutation in unexpected ways. There are two perfect shuffles that differ according to whether the first card down comes from the top or bottom half. A perfect out-shuffle leaves the top card on top, that is, outside the deck. A perfect in-shuffle leaves the top card at the second card, that is, inside the deck.
A reverse perfect shuffle is just the opposite. See Figure 3 from Magical Mathematics: The Mathematical Ideas That Animate Great Magic Tricks by Persi Diaconis and Ron Graham. After alternating cards are separated into two halves, one half is placed atop the other. While perfect shuffles are one of the most difficult sleights of hand, this simple process of alternate up- and down-jogging of cards can be performed by most anyone. As before, a reverse perfect out-shuffle leaves the top card on top, that is, outside the deck. A reverse perfect in-shuffle leaves the top card right after the middle of the deck, that is, inside the deck.
Quiz/exam preview: While not required for this homework, look at the written exercises at http://cs.gettysburg.edu/~tneller/resources/ai-search/uninformed-java/index.html to get a sense of questions I commonly include on quizzes and exams.


Namespace Dapplo.HttpExtensions
Classes
DataContractJsonSerializerStrategy
HttpBehaviour
This is the default implementation of the IHttpBehaviour, see IHttpBehaviour for details Most values are initialized via the HttpExtensionsGlobals
HttpClientExtensions
Extensions for the HttpClient class
HttpContentExtensions
Extensions for the HttpContent
HttpExtensionsGlobals
These are the globals for some of the important configurable settings When a HttpBehaviour is created, some of the values from here will be copied. (unless diffently specified)
HttpRequestMessageExtensions
Extensions for the HttpRequestMessage class
HttpResponse<TResponse, TErrorResponse>
This container can be used to get the details of a response. It also makes it possible to process the error information, and eventually do something different. You can specify your own container, by using the HttpAttribute.
HttpResponseMessageExtensions
Extensions for the HttpResponseMessage class
JsonArray
Represents the json array.
JsonObject
Represents the json object.
MiscExtensions
Misc extensions
PocoJsonSerializerStrategy
SimpleJson
This class encodes and decodes JSON strings. Spec. details, see http://www.json.org/
JSON uses Arrays and Objects. These correspond here to the datatypes JsonArray(IList
UriActionExtensions
Uri extension which perform an action
UriModifyExtensions
Uri extensions which modify an Uri (return a new one)
UriParseExtensions
Uri extensions which help with parsing
Interfaces
IChangeableHttpBehaviour
This interface extends the IHttpBehaviour but makes it possible to change the values. A use-case would be to call Clone on the IHttpBehaviour and modify the settings, return/assign the new value to a IHttpBehaviour This would be needed to pass the IHttpBehaviour via a CallContext.
IHttpBehaviour
The IHttpBehaviour is used to control the behaviour of all operations in the HttpExtensions library.
IHttpContentConverter
This interface is used for all
IHttpSettings
Interface for the global settings, as the DefaultValue attributes are set this CAN be used with Dapplo.Config.
Best example would be:
[IniSection("Network"), Display(Description = "Network / HTTP Settings")]
public interface IHttpConfig : IHttpSettings, IIniSection {
}
(Yes, it's can be empty, the settings are in the IHttpSettings interface) and than assign the generated instance to HttpExtensionsGlobals
IJsonSerializer
This interface makes it possible to change the Json serializer which is used for de- serializing JSON. As a default implementation is used, using SimpleJson.


{% extends "csat/confirm.html" %} {% block page_title %}Confirm deletion?{% endblock %} {% block message %}
Are you sure you want to permanently delete the acquisiton session configuration named "{{ session.name }}"?
This action cannot be undone.
{% endblock %} {% block actions %} No, cancel {% endblock %}


Relic Watcher:
You have chosen the correct memoir. As a final test, I will ask a simple question. If you answer correctly, you will be deemed qualified to take the memoir with you.
You won't be able to leave if you don't.
I'm ready for the test.


The Evening Standard newspaper has announced plans to make job cuts in both editorial and commercial departments
as part of a major restructure that will shift the company’s
focus to its digital and mobile platforms.
But the printed edition of the newspaper will be retained under the strategy, which was set out to staff this morning by the company’s new chief executive,
Charles Yardley, as he informed them that 115 jobs are likely to be lost – including 69 out of 167 editorial positions.
Mr Yardley told The Independent that the move was part of a long-term plan rather than solely a response to the coronavirus downturn,
which has hit many publishers’ revenues hard.
Home


Search the US by State
Stolen Bike
start date
end date
Select color:
unkown
Black
Blue
Brown
Green
Orange
Pink
Purple
Red
Silver or Grey
Stickers tape or other cover-up
Teal
White
Yellow or Gold
Search
Previous Page
Next Page


Our impetus for this project was the Kleiner Perkins challenge for the social good.
At Los Altos Hacks, we reasearched actual Burmese farming practices before implemeting the app in Java.
Taking into account evaportranspiration and the crop factors, we calculate the liters/day/plot
Based off crop and fertilizer type, exact amount of fertilizer needed is returned
Farmers can delineate and manage plots, focusing on crop rotation
Farmers can easily manage their land by walking around a plot, and designating its contents.
All data is stored locally on the device, then synced with a cloud when network connection becomes available.
How long and when to harvest a certain plot and crop.


Native Windows GUI: Controls
Controls are UI elements that can be interacted with. Native windows GUI wraps over 25 different controls in a safe rust-friendly interface.
This section explains the basics of using NWG controls.
To learn how to use controls with
native-windows-derive
see
the derive section
Control builder
Controls are created using a
builder API. On each control type, the method
builder
can be
called in order to instantiate a builder object. Builder names use the following format:
[ControlName]Builder
. Ex: (
ButtonBuilder
).
Each control documentation enumerates the properties accepted by the builder.
use native_windows_gui as nwg;
fn build_button(button: &mut nwg::Button, window: &nwg::Window, font: &nwg::Font) {
nwg::Button::builder()
.text("Hello")
.flags(nwg::ButtonFlags::VISIBLE | nwg::ButtonFlags::CHECK)
.font(Some(font))
.parent(window)
.build(button);
}
Control methods
NWG wraps almost every controls functionalities behind object methods. Fonctionnalities usually come in get/set pair.
The syntax used is
[property]()
for getters and
set_[property](value)
for setters. Example:
fn test(button: &Button) {
button.visible();
button.set_visible(true);
}
Methods of NWG never takes a mutable borrow. This is because most methods maps directy to a single winapi call.
And because the application data will almost certaintly be behind a
Rc
, having to put each control behind a refcell would be HELL.
Every NWG controls implements the
Default
trait. A control created from this is marked as
uninitialized.
Calling the methods of an uninitialized control will cause a
panic.
Window / Container controls
Most controls in NWG cannot hold children. Those that can are called "container controls". This includes
Window,
Tab Container,
and
Tab. TabContainer should only contains tab controls.
Container controls can also use
layouts. More on that in
the layout section
The window control is be the base of any GUI application. It represents a top level system window. Every NWG application will have a window.
This also includes system tray applications. In this case, the window should be a
MessageWindow
, an invisible window that only dispatch messages.
Window controls are highly customizable. System decorated window (aka normal window), popup window, and transparent window can be created by selecting the right
WindowFlags
.
nwg::Window::builder()
.flags(nwg::WindowFlags::WINDOW | nwg::WindowFlags::VISIBLE)
.size((300, 115))
.position((300, 300))
.title("Basic example")
.build(&mut data.window)?;
Controls hierarchy
All non-window control require a parent. If no parent is defined when building a new control, the build function will return a
NwgError::ControlCreationError
.
Control events
Controls can raise
Events
when interacted with. The events that can be raised by a control are
in the their documentation.
All controls have specific events (ex:
OnButtonClick
) and generic events that are shared (ex:
OnPaint
).
More on this in the next section
Implementation
To keep compile time low, most controls are feature-gated.
Every control is implemented as a wrapper over a low level window handle. As such,
most* of them only take the size of a pointer.
Some built-in controls lacks critical feature on their own. To fix this, nwg extends those controls with
raw events handlers.
Also, controls that support custom collections (ex: ListBox and ComboBox) also uses Rust collections internally to store the rust data.
Freeing
Controls implement
Drop
and are freed when they go out of scope.


Hamburger Patties
🍽 Servings: 6 patties
Ingredients
- 1 cup soft bread crumb
- ½ cup milk
- 1 ½ pound ground beef
- 1 medium onion, chopped
- ½ teaspoon salt
- dash pepper
- ½ teaspoon cayenne
- 1 teaspoon Worcestershire sauce
- 2 tablespoons of fat or salad oil
Directions
- Combine all ingredients except fat: mix well; shape into 6 patties.
- Heat fat in skillet.
- Brown patties on all sides; lower heat; cook to desired degree of
doneness.
Contribution
Recipe tags:
american
quick
beef
sandwich


| Package | Description |
|---|---|
| la.decomposition | |
| la.io | |
| la.matrix | |
| la.vector | |
| ml.classification | |
| ml.clustering | |
| ml.kernel | |
| ml.manifold | |
| ml.optimization | |
| ml.random | |
| ml.recommendation | |
| ml.recovery | |
| ml.regression | |
| ml.sequence | |
| ml.subspace | |
| ml.temporal | |
| ml.topics | |
| ml.utils |
| Modifier and Type | Method and Description |
|---|---|
static Matrix[] |
SingularValueDecomposition.decompose(Matrix A)
Do singular value decompose for a general real matrix A, i.e.
|
static Matrix[] |
QRDecomposition.decompose(Matrix A)
QR decomposition with column pivoting.
|
static Matrix[] |
LUDecomposition.decompose(Matrix A)
Do LU decomposition from a square real matrix.
|
static Matrix[] |
EigenValueDecomposition.decompose(Matrix A)
Do eigenvalue decomposition for a real symmetric matrix,
i.e.
|
static Matrix[] |
SingularValueDecomposition.decompose(Matrix A,
boolean computeUV)
Do singular value decompose for a general real matrix A, i.e.
|
static Matrix[] |
EigenValueDecomposition.decompose(Matrix A,
boolean computeV)
Do eigenvalue decomposition for a real symmetric matrix,
i.e.
|
Matrix |
EigenValueDecomposition.getD()
Get a diagonal matrix containing the eigenvalues
in decreasing order.
|
Matrix |
LUDecomposition.getL()
Get the lower triangular matrix in the LU decomposition.
|
Matrix |
QRDecomposition.getP()
Get the column permutation matrix in the QR decomposition.
|
Matrix |
LUDecomposition.getP()
Get the row permutation matrix in the LU decomposition.
|
Matrix |
QRDecomposition.getQ()
Get the orthogonal matrix in the QR decomposition.
|
Matrix |
QRDecomposition.getR()
Get the upper triangular matrix in the QR decomposition.
|
Matrix |
SingularValueDecomposition.getS()
Get the matrix with its diagonal being all
singular values in decreasing order.
|
Matrix |
SingularValueDecomposition.getU()
Get the left singular vectors.
|
Matrix |
LUDecomposition.getU()
Get the upper triangular matrix in the LU decomposition.
|
Matrix |
SingularValueDecomposition.getV()
Get the right singular vectors.
|
Matrix |
EigenValueDecomposition.getV()
Get eigenvectors.
|
Matrix |
LUDecomposition.inverse()
Compute the inverse of this real square matrix.
|
Matrix |
QRDecomposition.solve(double[][] B)
Solve the system of linear equations AX = B in the least
square sense, i.e.
|
Matrix |
LUDecomposition.solve(double[][] B)
Solve the system of linear equations AX = B for a real
square matrix A.
|
Matrix |
QRDecomposition.solve(Matrix B)
Solve the system of linear equations AX = B in the least
square sense, i.e.
|
Matrix |
LUDecomposition.solve(Matrix B)
Solve the system of linear equations AX = B for a real
square matrix A.
|
| Modifier and Type | Method and Description |
|---|---|
static double[] |
EigenValueDecomposition.computeEigenvalues(Matrix A)
Only eigenvalues of a symmetric real matrix are computed.
|
static double[] |
SingularValueDecomposition.computeSingularValues(Matrix A)
Only singular values of a matrix are computed.
|
static Matrix[] |
SingularValueDecomposition.decompose(Matrix A)
Do singular value decompose for a general real matrix A, i.e.
|
static Matrix[] |
QRDecomposition.decompose(Matrix A)
QR decomposition with column pivoting.
|
static Matrix[] |
LUDecomposition.decompose(Matrix A)
Do LU decomposition from a square real matrix.
|
static Matrix[] |
EigenValueDecomposition.decompose(Matrix A)
Do eigenvalue decomposition for a real symmetric matrix,
i.e.
|
static Matrix[] |
SingularValueDecomposition.decompose(Matrix A,
boolean computeUV)
Do singular value decompose for a general real matrix A, i.e.
|
static Matrix[] |
EigenValueDecomposition.decompose(Matrix A,
boolean computeV)
Do eigenvalue decomposition for a real symmetric matrix,
i.e.
|
static int |
SingularValueDecomposition.rank(Matrix A)
Compute the rank of a matrix.
|
Matrix |
QRDecomposition.solve(Matrix B)
Solve the system of linear equations AX = B in the least
square sense, i.e.
|
Matrix |
LUDecomposition.solve(Matrix B)
Solve the system of linear equations AX = B for a real
square matrix A.
|
| Constructor and Description |
|---|
EigenValueDecomposition(Matrix A)
Construct this eigenvalue decomposition instance
from a real symmetric matrix.
|
EigenValueDecomposition(Matrix A,
boolean computeV)
Construct this eigenvalue decomposition instance
from a real symmetric matrix.
|
EigenValueDecomposition(Matrix A,
double tol)
Construct this eigenvalue decomposition instance
from a real symmetric matrix.
|
LUDecomposition(Matrix A)
Construct an LUDecomposition instance from a square real matrix.
|
QRDecomposition(Matrix A)
Construct a QRDecomposition instance from an arbitrary
real matrix A.
|
SingularValueDecomposition(Matrix A)
Construct this singular value decomposition instance
from a matrix.
|
SingularValueDecomposition(Matrix A,
boolean computeUV)
Construct this singular value decomposition instance
from a matrix.
|
| Modifier and Type | Field and Description |
|---|---|
Matrix |
DataSet.X
Data matrix (nExample x nFeature).
|
Matrix |
Data.X
Data matrix (nExample x nFeature).
|
| Modifier and Type | Method and Description |
|---|---|
static Matrix |
IO.docTermCountArray2Matrix(java.util.ArrayList<java.util.TreeMap<java.lang.Integer,java.lang.Integer>> docTermCountArray)
Convert a docTermCountArray instance of type {code
ArrayList
|
static Matrix |
IO.loadMatrix(java.lang.String filePath)
Read a matrix from a text file.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
IO.save(Matrix A,
java.lang.String filePath)
Write a matrix into a text file.
|
static void |
IO.save(java.lang.String filePath,
Matrix A)
Write a matrix into a text file.
|
static void |
IO.saveDenseMatrix(Matrix A,
java.lang.String filePath)
Write a dense matrix into a text file.
|
static void |
IO.saveDenseMatrix(java.lang.String filePath,
Matrix A)
Write a dense matrix into a text file.
|
static void |
IO.saveMatrix(Matrix A,
java.lang.String filePath)
Write a matrix into a text file.
|
static void |
IO.saveMatrix(java.lang.String filePath,
Matrix A)
Write a matrix into a text file.
|
static void |
IO.saveSparseMatrix(Matrix A,
java.lang.String filePath)
Write a sparse matrix into a text file.
|
static void |
IO.saveSparseMatrix(java.lang.String filePath,
Matrix A)
Write a sparse matrix into a text file.
|
static java.util.ArrayList<java.lang.String> |
Data.writeDataSet(Matrix X,
double[] Y)
Write a data set to a string array in the LIBSVM format.
|
static void |
Data.writeDataSet(Matrix X,
double[] Y,
java.lang.String filePath)
Write a data set to a text file in the LIBSVM format.
|
static java.util.ArrayList<java.lang.String> |
DataSet.writeDataSet(Matrix X,
int[] Y)
Write a data set to a string array in the LIBSVM format.
|
static void |
DataSet.writeDataSet(Matrix X,
int[] Y,
java.lang.String filePath)
Write a data set to a text file in the LIBSVM format.
|
| Constructor and Description |
|---|
Data(Matrix X,
double[] Y) |
DataSet(Matrix X,
int[] Y) |
| Modifier and Type | Class and Description |
|---|---|
class |
DenseMatrix
A Java implementation of dense matrices.
|
class |
SparseMatrix
A Java implementation of sparse matrices with combined compressed
sparse column (CSC) and compressed sparse row (CSR).
|
| Modifier and Type | Method and Description |
|---|---|
Matrix |
SparseMatrix.clone() |
Matrix |
DenseMatrix.clone() |
Matrix |
SparseMatrix.copy() |
Matrix |
Matrix.copy()
Get a deep copy of this matrix.
|
Matrix |
DenseMatrix.copy() |
Matrix |
SparseMatrix.getColumnMatrix(int c) |
Matrix |
Matrix.getColumnMatrix(int c)
Get a column matrix.
|
Matrix |
DenseMatrix.getColumnMatrix(int c) |
Matrix |
SparseMatrix.getColumns(int... selectedColumns) |
Matrix |
Matrix.getColumns(int... selectedColumns)
Get columns of specified column indices as a matrix.
|
Matrix |
DenseMatrix.getColumns(int... selectedColumns) |
Matrix |
SparseMatrix.getColumns(int startColumn,
int endColumn) |
Matrix |
Matrix.getColumns(int startColumn,
int endColumn)
Get columns from startColumn to endColumn as a matrix.
|
Matrix |
DenseMatrix.getColumns(int startColumn,
int endColumn) |
Matrix |
SparseMatrix.getRowMatrix(int r) |
Matrix |
Matrix.getRowMatrix(int r)
Get a row matrix.
|
Matrix |
DenseMatrix.getRowMatrix(int r) |
Matrix |
SparseMatrix.getRows(int... selectedRows) |
Matrix |
Matrix.getRows(int... selectedRows)
Get rows of specified row indices as a matrix.
|
Matrix |
DenseMatrix.getRows(int... selectedRows) |
Matrix |
SparseMatrix.getRows(int startRow,
int endRow) |
Matrix |
Matrix.getRows(int startRow,
int endRow)
Get rows from startRow to endRow as a matrix.
|
Matrix |
DenseMatrix.getRows(int startRow,
int endRow) |
Matrix |
SparseMatrix.getSubMatrix(int[] selectedRows,
int[] selectedColumns) |
Matrix |
Matrix.getSubMatrix(int[] selectedRows,
int[] selectedColumns)
Get a submatrix.
|
Matrix |
DenseMatrix.getSubMatrix(int[] selectedRows,
int[] selectedColumns) |
Matrix |
SparseMatrix.getSubMatrix(int startRow,
int endRow,
int startColumn,
int endColumn) |
Matrix |
Matrix.getSubMatrix(int startRow,
int endRow,
int startColumn,
int endColumn)
Get a submatrix.
|
Matrix |
DenseMatrix.getSubMatrix(int startRow,
int endRow,
int startColumn,
int endColumn) |
Matrix |
SparseMatrix.minus(double v) |
Matrix |
Matrix.minus(double v)
This - v.
|
Matrix |
DenseMatrix.minus(double v) |
Matrix |
SparseMatrix.minus(Matrix A) |
Matrix |
Matrix.minus(Matrix A)
This - A.
|
Matrix |
DenseMatrix.minus(Matrix A) |
Matrix |
SparseMatrix.mtimes(Matrix A) |
Matrix |
Matrix.mtimes(Matrix A)
This * A.
|
Matrix |
DenseMatrix.mtimes(Matrix A) |
Matrix |
SparseMatrix.plus(double v) |
Matrix |
Matrix.plus(double v)
This + v.
|
Matrix |
DenseMatrix.plus(double v) |
Matrix |
SparseMatrix.plus(Matrix A) |
Matrix |
Matrix.plus(Matrix A)
This + A.
|
Matrix |
DenseMatrix.plus(Matrix A) |
Matrix |
SparseMatrix.times(double v) |
Matrix |
Matrix.times(double v)
This .* v.
|
Matrix |
DenseMatrix.times(double v) |
Matrix |
SparseMatrix.times(Matrix A) |
Matrix |
Matrix.times(Matrix A)
This .* A.
|
Matrix |
DenseMatrix.times(Matrix A) |
Matrix |
SparseMatrix.transpose() |
Matrix |
Matrix.transpose()
The transpose of this matrix.
|
Matrix |
DenseMatrix.transpose() |
| Modifier and Type | Method and Description |
|---|---|
Matrix |
SparseMatrix.minus(Matrix A) |
Matrix |
Matrix.minus(Matrix A)
This - A.
|
Matrix |
DenseMatrix.minus(Matrix A) |
Matrix |
SparseMatrix.mtimes(Matrix A) |
Matrix |
Matrix.mtimes(Matrix A)
This * A.
|
Matrix |
DenseMatrix.mtimes(Matrix A) |
Matrix |
SparseMatrix.plus(Matrix A) |
Matrix |
Matrix.plus(Matrix A)
This + A.
|
Matrix |
DenseMatrix.plus(Matrix A) |
void |
SparseMatrix.setColumnMatrix(int c,
Matrix A) |
void |
Matrix.setColumnMatrix(int c,
Matrix A)
Set the c-th column by a column matrix A.
|
void |
DenseMatrix.setColumnMatrix(int c,
Matrix A) |
void |
SparseMatrix.setRowMatrix(int r,
Matrix A) |
void |
Matrix.setRowMatrix(int r,
Matrix A)
Set the r-th row by a row matrix A.
|
void |
DenseMatrix.setRowMatrix(int r,
Matrix A) |
Matrix |
SparseMatrix.times(Matrix A) |
Matrix |
Matrix.times(Matrix A)
This .* A.
|
Matrix |
DenseMatrix.times(Matrix A) |
| Modifier and Type | Method and Description |
|---|---|
Vector |
Vector.operate(Matrix A)
Vector matrix multiplication, i.e.
|
Vector |
SparseVector.operate(Matrix A) |
Vector |
DenseVector.operate(Matrix A) |
| Modifier and Type | Method and Description |
|---|---|
Matrix |
Classifier.getProjectionMatrix()
Get projection matrix for this classifier.
|
Matrix |
Classifier.getTrainingLabelMatrix()
Get ground truth label matrix for training data.
|
static Matrix |
Classifier.labelIndexArray2LabelMatrix(int[] labelIndices,
int nClass)
Convert a label index array to a label matrix.
|
Matrix |
Classifier.predictLabelMatrix(double[][] Xt)
Predict the label matrix given test data formated as an
original 2D
double array. |
Matrix |
MaxEnt.predictLabelMatrix(double[][][] data)
Predict the label matrix given test data formated as a
3D
double array. |
Matrix |
Classifier.predictLabelMatrix(Matrix Xt)
Predict the label matrix given test data formated as an
original data matrix.
|
Matrix |
AdaBoost.predictLabelMatrix(Matrix Xt) |
Matrix |
MaxEnt.predictLabelMatrix(Matrix[] Ft)
Predict the label matrix given test data formated as a 1D
Matrix array. |
Matrix |
Classifier.predictLabelScoreMatrix(double[][] Xt)
Predict the label score matrix given test data formated as an
original data matrix.
|
Matrix |
MaxEnt.predictLabelScoreMatrix(double[][][] data)
Predict the label score matrix given test data formated as a
3D
double array. |
Matrix |
MaxEnt.predictLabelScoreMatrix(Matrix Ft) |
Matrix |
LogisticRegressionByNonnegativePLBFGS.predictLabelScoreMatrix(Matrix Xt) |
Matrix |
LogisticRegressionByNonlinearConjugateGradient.predictLabelScoreMatrix(Matrix Xt) |
Matrix |
LogisticRegressionByBoundConstrainedPLBFGS.predictLabelScoreMatrix(Matrix Xt) |
Matrix |
LogisticRegression.predictLabelScoreMatrix(Matrix Xt) |
Matrix |
LinearMCSVM.predictLabelScoreMatrix(Matrix Xt) |
Matrix |
LinearBinarySVM.predictLabelScoreMatrix(Matrix Xt) |
abstract Matrix |
Classifier.predictLabelScoreMatrix(Matrix Xt)
Predict the label score matrix given test data formated as an
original data matrix.
|
Matrix |
AdaBoost.predictLabelScoreMatrix(Matrix Xt) |
Matrix |
MaxEnt.predictLabelScoreMatrix(Matrix[] Ft)
Predict the label score matrix given test data formated as a
Matrix array. |
| Modifier and Type | Method and Description |
|---|---|
void |
Classifier.feedData(Matrix X)
Feed training data with original data matrix for this classifier.
|
void |
MaxEnt.feedData(Matrix[] F)
Feed features for this maximum entropy model.
|
void |
Classifier.feedLabels(Matrix Y)
Feed labels for training data from a matrix.
|
static Vector[] |
Classifier.getVectors(Matrix X)
Each row of X is a feature vector without the bias term.
|
static int[] |
Classifier.labelScoreMatrix2LabelIndexArray(Matrix Y)
Convert a label matrix to a label index array.
|
int[] |
Classifier.predict(Matrix Xt)
Predict the labels for the test data formated as an original data matrix.
|
int[] |
MaxEnt.predict(Matrix[] Ft)
Predict labels for the test data formated as a 1D
Matrix array. |
Matrix |
Classifier.predictLabelMatrix(Matrix Xt)
Predict the label matrix given test data formated as an
original data matrix.
|
Matrix |
AdaBoost.predictLabelMatrix(Matrix Xt) |
Matrix |
MaxEnt.predictLabelMatrix(Matrix[] Ft)
Predict the label matrix given test data formated as a 1D
Matrix array. |
Matrix |
MaxEnt.predictLabelScoreMatrix(Matrix Ft) |
Matrix |
LogisticRegressionByNonnegativePLBFGS.predictLabelScoreMatrix(Matrix Xt) |
Matrix |
LogisticRegressionByNonlinearConjugateGradient.predictLabelScoreMatrix(Matrix Xt) |
Matrix |
LogisticRegressionByBoundConstrainedPLBFGS.predictLabelScoreMatrix(Matrix Xt) |
Matrix |
LogisticRegression.predictLabelScoreMatrix(Matrix Xt) |
Matrix |
LinearMCSVM.predictLabelScoreMatrix(Matrix Xt) |
Matrix |
LinearBinarySVM.predictLabelScoreMatrix(Matrix Xt) |
abstract Matrix |
Classifier.predictLabelScoreMatrix(Matrix Xt)
Predict the label score matrix given test data formated as an
original data matrix.
|
Matrix |
AdaBoost.predictLabelScoreMatrix(Matrix Xt) |
Matrix |
MaxEnt.predictLabelScoreMatrix(Matrix[] Ft)
Predict the label score matrix given test data formated as a
Matrix array. |
| Modifier and Type | Method and Description |
|---|---|
Matrix |
Clustering.getCenters()
Get cluster centers.
|
Matrix |
Clustering.getData()
Fetch data matrix.
|
Matrix |
Clustering.getIndicatorMatrix()
Get cluster indicator matrix.
|
| Modifier and Type | Method and Description |
|---|---|
void |
L1NMF.clustering(Matrix G0) |
void |
Clustering.clustering(Matrix G0)
Do clustering with a specified initializer.
|
void |
Clustering.feedData(Matrix dataMatrix)
Feed training data for this clustering algorithm.
|
static double |
Clustering.getAccuracy(Matrix G,
Matrix groundTruth)
Evaluating the clustering performance of this clustering algorithm
by using the ground truth.
|
void |
SpectralClustering.initialize(Matrix G0)
For spectral clustering, we don't need initialization in the
current implementation.
|
void |
L1NMF.initialize(Matrix G0) |
void |
Clustering.initialize(Matrix G0)
Initialize the indicator matrix.
|
| Modifier and Type | Method and Description |
|---|---|
static Matrix |
KernelByColumns.calcKernel(java.lang.String kernelType,
double kernelParam,
Matrix X)
Computes Gram matrix of a specified kernel.
|
static Matrix |
Kernel.calcKernel(java.lang.String kernelType,
double kernelParam,
Matrix X)
Computes Gram matrix of a specified kernel.
|
static Matrix |
KernelByColumns.calcKernel(java.lang.String kernelType,
double kernelParam,
Matrix X1,
Matrix X2)
Computes Gram matrix of a specified kernel.
|
static Matrix |
Kernel.calcKernel(java.lang.String kernelType,
double kernelParam,
Matrix X1,
Matrix X2)
Computes Gram matrix of a specified kernel.
|
static Matrix |
KernelByColumns.calcKernel(java.lang.String kernelType,
double kernelParam,
Vector[] A,
Vector[] B)
Computes Gram matrix of a specified kernel.
|
static Matrix |
Kernel.calcKernel(java.lang.String kernelType,
double kernelParam,
Vector[] A,
Vector[] B)
Computes Gram matrix of a specified kernel.
|
| Modifier and Type | Method and Description |
|---|---|
static Matrix |
KernelByColumns.calcKernel(java.lang.String kernelType,
double kernelParam,
Matrix X)
Computes Gram matrix of a specified kernel.
|
static Matrix |
Kernel.calcKernel(java.lang.String kernelType,
double kernelParam,
Matrix X)
Computes Gram matrix of a specified kernel.
|
static Matrix |
KernelByColumns.calcKernel(java.lang.String kernelType,
double kernelParam,
Matrix X1,
Matrix X2)
Computes Gram matrix of a specified kernel.
|
static Matrix |
Kernel.calcKernel(java.lang.String kernelType,
double kernelParam,
Matrix X1,
Matrix X2)
Computes Gram matrix of a specified kernel.
|
| Modifier and Type | Method and Description |
|---|---|
static Matrix |
ManifoldByColumns.adjacency(Matrix X,
java.lang.String type,
double param,
java.lang.String distFunc)
Compute the symmetric adjacency matrix of the data set represented as
a real data matrix X.
|
static Matrix |
Manifold.adjacency(Matrix X,
java.lang.String type,
double param,
java.lang.String distFunc)
Compute the symmetric adjacency matrix of the data set represented as
a real data matrix X.
|
static Matrix |
ManifoldByColumns.adjacencyDirected(Matrix X,
java.lang.String type,
double param,
java.lang.String distFunc)
Compute the directed adjacency matrix of the data set represented as
a real data matrix X.
|
static Matrix |
Manifold.adjacencyDirected(Matrix X,
java.lang.String type,
double param,
java.lang.String distFunc)
Compute the directed adjacency matrix of the data set represented as
a real data matrix X.
|
static Matrix |
ManifoldByColumns.calcLLR(Matrix X,
double NN,
java.lang.String distFunc,
java.lang.String kernelType,
double kernelParam,
double lambda)
Compute local learning regularization matrix.
|
static Matrix |
Manifold.calcLLR(Matrix X,
double NN,
java.lang.String distFunc,
java.lang.String kernelType,
double kernelParam,
double lambda)
Compute local learning regularization matrix.
|
static Matrix |
Manifold.cosine(Matrix A,
Matrix B)
Compute the cosine distance matrix between row vectors in matrix A
and row vectors in matrix B.
|
static Matrix |
ManifoldByColumns.cosineByColumns(Matrix A,
Matrix B)
Compute the cosine distance matrix between column vectors in matrix A
and column vectors in matrix B.
|
static Matrix |
Manifold.euclidean(Matrix A,
Matrix B)
Compute the Euclidean distance matrix between row vectors in matrix A
and row vectors in matrix B.
|
static Matrix |
ManifoldByColumns.euclideanByColumns(Matrix A,
Matrix B)
Compute the Euclidean distance matrix between column vectors in matrix A
and column vectors in matrix B.
|
static Matrix |
ManifoldByColumns.laplacian(Matrix X,
java.lang.String type,
GraphOptions options)
Calculate the graph Laplacian of the adjacency graph of a data set
represented as columns of a matrix X.
|
static Matrix |
Manifold.laplacian(Matrix X,
java.lang.String type,
GraphOptions options)
Calculate the graph Laplacian of the adjacency graph of a data set
represented as rows of a matrix X.
|
| Modifier and Type | Method and Description |
|---|---|
static Matrix |
ManifoldByColumns.adjacency(Matrix X,
java.lang.String type,
double param,
java.lang.String distFunc)
Compute the symmetric adjacency matrix of the data set represented as
a real data matrix X.
|
static Matrix |
Manifold.adjacency(Matrix X,
java.lang.String type,
double param,
java.lang.String distFunc)
Compute the symmetric adjacency matrix of the data set represented as
a real data matrix X.
|
static Matrix |
ManifoldByColumns.adjacencyDirected(Matrix X,
java.lang.String type,
double param,
java.lang.String distFunc)
Compute the directed adjacency matrix of the data set represented as
a real data matrix X.
|
static Matrix |
Manifold.adjacencyDirected(Matrix X,
java.lang.String type,
double param,
java.lang.String distFunc)
Compute the directed adjacency matrix of the data set represented as
a real data matrix X.
|
static Matrix |
ManifoldByColumns.calcLLR(Matrix X,
double NN,
java.lang.String distFunc,
java.lang.String kernelType,
double kernelParam,
double lambda)
Compute local learning regularization matrix.
|
static Matrix |
Manifold.calcLLR(Matrix X,
double NN,
java.lang.String distFunc,
java.lang.String kernelType,
double kernelParam,
double lambda)
Compute local learning regularization matrix.
|
static Matrix |
Manifold.cosine(Matrix A,
Matrix B)
Compute the cosine distance matrix between row vectors in matrix A
and row vectors in matrix B.
|
static Vector |
Manifold.cosine(Vector V,
Matrix B)
Compute the cosine distance matrix between a vector V
and row vectors in matrix B.
|
static Matrix |
ManifoldByColumns.cosineByColumns(Matrix A,
Matrix B)
Compute the cosine distance matrix between column vectors in matrix A
and column vectors in matrix B.
|
static Matrix |
Manifold.euclidean(Matrix A,
Matrix B)
Compute the Euclidean distance matrix between row vectors in matrix A
and row vectors in matrix B.
|
static Vector |
Manifold.euclidean(Vector V,
Matrix B)
Compute the Euclidean distance matrix between a vector V
and row vectors in matrix B.
|
static Matrix |
ManifoldByColumns.euclideanByColumns(Matrix A,
Matrix B)
Compute the Euclidean distance matrix between column vectors in matrix A
and column vectors in matrix B.
|
static Matrix |
ManifoldByColumns.laplacian(Matrix X,
java.lang.String type,
GraphOptions options)
Calculate the graph Laplacian of the adjacency graph of a data set
represented as columns of a matrix X.
|
static Matrix |
Manifold.laplacian(Matrix X,
java.lang.String type,
GraphOptions options)
Calculate the graph Laplacian of the adjacency graph of a data set
represented as rows of a matrix X.
|
| Modifier and Type | Field and Description |
|---|---|
Matrix |
QPSolution.lambda_opt |
Matrix |
QPSolution.nu_opt |
Matrix |
QPSolution.optimizer |
Matrix |
PhaseIResult.optimizer |
| Modifier and Type | Method and Description |
|---|---|
Matrix |
ProxPlus.compute(double t,
Matrix X)
Compute prox_th(X) where h = I_+(X).
|
Matrix |
ProxLInfinity.compute(double t,
Matrix X)
Compute prox_th(X) where h = lambda * || X ||_{\infty}.
|
Matrix |
ProxL2Square.compute(double t,
Matrix X)
Compute prox_th(X) where h = lambda * || X ||_F^2.
|
Matrix |
ProxL2.compute(double t,
Matrix X)
Compute prox_th(X) where h = lambda * || X ||_F.
|
Matrix |
ProxL1.compute(double t,
Matrix X)
Compute prox_th(X) where h = lambda * || X ||_1.
|
Matrix |
ProximalMapping.compute(double t,
Matrix X)
Compute prox_th(X).
|
Matrix |
Prox.compute(double t,
Matrix X)
Compute prox_th(X) where h = 0.
|
Matrix |
ProjLInfinity.compute(double t,
Matrix X)
Compute proj_{tC}(X) where C = {X: || X ||_{\infty} <= 1}.
|
Matrix |
ProjL2.compute(double t,
Matrix X)
Compute proj_{tC}(X) where C = {X: || X ||_2 <= 1}.
|
Matrix |
ProjL1.compute(double t,
Matrix X)
Compute proj_{tC}(X) where C = {X: || X ||_1 <= 1}.
|
Matrix |
Projection.compute(double t,
Matrix X)
Compute proj_tC(X).
|
static Matrix |
PrimalDualInteriorPoint.getOptimalLambda()
Get Lambda.
|
static Matrix |
PrimalDualInteriorPoint.getOptimalNu()
Get Nu.
|
static Matrix |
ShrinkageOperator.shrinkage(Matrix X,
double t)
Soft-thresholding (shrinkage) operator, which is defined as
S_{t}[x] = argmin_u 1/2 * || u - x ||^2 + t||u||_1
which is actually prox_{t||.||_1}(x).
|
| Modifier and Type | Method and Description |
|---|---|
Matrix |
ProxPlus.compute(double t,
Matrix X)
Compute prox_th(X) where h = I_+(X).
|
Matrix |
ProxLInfinity.compute(double t,
Matrix X)
Compute prox_th(X) where h = lambda * || X ||_{\infty}.
|
Matrix |
ProxL2Square.compute(double t,
Matrix X)
Compute prox_th(X) where h = lambda * || X ||_F^2.
|
Matrix |
ProxL2.compute(double t,
Matrix X)
Compute prox_th(X) where h = lambda * || X ||_F.
|
Matrix |
ProxL1.compute(double t,
Matrix X)
Compute prox_th(X) where h = lambda * || X ||_1.
|
Matrix |
ProximalMapping.compute(double t,
Matrix X)
Compute prox_th(X).
|
Matrix |
Prox.compute(double t,
Matrix X)
Compute prox_th(X) where h = 0.
|
Matrix |
ProjLInfinity.compute(double t,
Matrix X)
Compute proj_{tC}(X) where C = {X: || X ||_{\infty} <= 1}.
|
Matrix |
ProjL2.compute(double t,
Matrix X)
Compute proj_{tC}(X) where C = {X: || X ||_2 <= 1}.
|
Matrix |
ProjL1.compute(double t,
Matrix X)
Compute proj_{tC}(X) where C = {X: || X ||_1 <= 1}.
|
Matrix |
Projection.compute(double t,
Matrix X)
Compute proj_tC(X).
|
void |
ProxPlus.compute(Matrix res,
double t,
Matrix X)
Compute prox_th(X) where h = I_+(X).
|
void |
ProxLInfinity.compute(Matrix res,
double t,
Matrix X)
Compute prox_th(X) where h = lambda * || X ||_{\infty}.
|
void |
ProxL2Square.compute(Matrix res,
double t,
Matrix X)
Compute prox_th(X) where h = lambda * || X ||_F^2.
|
void |
ProxL2.compute(Matrix res,
double t,
Matrix X)
Compute prox_th(X) where h = lambda * || X ||_F.
|
void |
ProxL1.compute(Matrix res,
double t,
Matrix X)
res = prox_th(X) where h = lambda * || X ||_1.
|
void |
ProximalMapping.compute(Matrix res,
double t,
Matrix X)
res = prox_th(X).
|
void |
Prox.compute(Matrix res,
double t,
Matrix X)
res = prox_th(X) where h = 0.
|
void |
ProjLInfinity.compute(Matrix res,
double t,
Matrix X)
Compute proj_{tC}(X) where C = {X: || X ||_{\infty} <= 1}.
|
void |
ProjL2.compute(Matrix res,
double t,
Matrix X)
Compute proj_{tC}(X) where C = {X: || X ||_2 <= 1}.
|
void |
ProjL1.compute(Matrix res,
double t,
Matrix X)
Compute proj_{tC}(X) where C = {X: || X ||_1 <= 1}.
|
void |
Projection.compute(Matrix res,
double t,
Matrix X)
res = proj_tC(X).
|
static PhaseIResult |
GeneralQP.phaseI(Matrix A,
Matrix b,
Matrix B,
Matrix d)
We demonstrate the implementation of phase I via primal-dual interior
point method to test whether the following problem is feasible:
|
static QPSolution |
GeneralQP.phaseII(Matrix Q,
Matrix c,
Matrix A,
Matrix b,
Matrix B,
Matrix d,
Matrix x0)
Phase II for solving a general quadratic programming problem formulated as
|
static boolean[] |
BoundConstrainedPLBFGS.run(Matrix Grad_t,
double fval_t,
double l,
double u,
double epsilon,
Matrix X_t)
Main entry for the LBFGS algorithm with bound constraints.
|
static boolean[] |
AcceleratedProximalGradient.run(Matrix Grad_t,
double gval_t,
double hval_t,
double epsilon,
Matrix X_t)
Main entry for the accelerated proximal gradient algorithm.
|
static boolean[] |
NonnegativePLBFGS.run(Matrix Grad_t,
double fval_t,
double epsilon,
Matrix X_t)
Main entry for the LBFGS algorithm.
|
static boolean[] |
NonlinearConjugateGradient.run(Matrix Grad_t,
double fval_t,
double epsilon,
Matrix X_t)
Main entry for the algorithm.
|
static boolean[] |
LBFGSOnSimplex.run(Matrix Grad_t,
double fval_t,
double epsilon,
Matrix X_t)
Main entry for the LBFGS algorithm.
|
static boolean[] |
LBFGS.run(Matrix Grad_t,
double fval_t,
double epsilon,
Matrix X_t)
Main entry for the LBFGS algorithm.
|
static boolean[] |
AcceleratedGradientDescent.run(Matrix Grad_t,
double gval_t,
double epsilon,
Matrix X_t)
Main entry for the accelerated proximal gradient algorithm.
|
static boolean[] |
BoundConstrainedPLBFGS.run(Matrix Grad_t,
double fval_t,
Matrix L,
Matrix U,
double epsilon,
Matrix X_t)
Main entry for the LBFGS algorithm with bound constraints.
|
static boolean[] |
PrimalDualInteriorPoint.run(Matrix A,
Matrix b,
Matrix H_x,
Matrix F_x,
Matrix DF_x,
Matrix G_f_x,
double fval,
Matrix x)
Run this optimization algorithm.
|
static boolean[] |
PrimalDualInteriorPoint.run(Matrix A,
Matrix b,
Matrix H_x,
Matrix F_x,
Matrix DF_x,
Matrix G_f_x,
double fval,
Matrix x_s,
Matrix l_opt,
Matrix v_opt)
Run this optimization algorithm.
|
static Matrix |
ShrinkageOperator.shrinkage(Matrix X,
double t)
Soft-thresholding (shrinkage) operator, which is defined as
S_{t}[x] = argmin_u 1/2 * || u - x ||^2 + t||u||_1
which is actually prox_{t||.||_1}(x).
|
static void |
ShrinkageOperator.shrinkage(Matrix res,
double t,
Matrix X)
Soft-thresholding (shrinkage) operator, which is defined as
S_{t}[x] = argmin_u 1/2 * || u - x ||^2 + t||u||_1
which is actually prox_{t||.||_1}(x).
|
static void |
ShrinkageOperator.shrinkage(Matrix res,
Matrix X,
double t)
Soft-thresholding (shrinkage) operator, which is defined as
S_{t}[x] = argmin_u 1/2 * || u - x ||^2 + t||u||_1
which is actually prox_{t||.||_1}(x).
|
static QPSolution |
QPWithBoundConstraints.solve(Matrix Q,
Matrix c,
double l,
double u,
double epsilon)
Solve this bound constrained QP problem.
|
static QPSolution |
QPWithBoundConstraints.solve(Matrix Q,
Matrix c,
double l,
double u,
double epsilon,
Matrix x0)
Solve this bound constrained QP problem.
|
static QPSolution |
GeneralQPViaPrimalDualInteriorPoint.solve(Matrix Q,
Matrix c,
Matrix A,
Matrix b,
Matrix B,
Matrix d)
Solve a general quadratic programming problem formulated as
|
static QPSolution |
GeneralQP.solve(Matrix Q,
Matrix c,
Matrix A,
Matrix b,
Matrix B,
Matrix d)
Solve a general quadratic programming problem formulated as
|
| Constructor and Description |
|---|
PhaseIResult(boolean feasible,
Matrix optimizer,
double optimum) |
PhaseIResult(Matrix optimizer,
double optimum) |
QPSolution(Matrix optimizer,
Matrix lambda_opt,
Matrix nu_opt,
double optimum) |
| Modifier and Type | Method and Description |
|---|---|
static Matrix |
MultivariateGaussianDistribution.mvnrnd(double[] MU,
double[][] SIGMA,
int cases)
Generate random samples chosen from the multivariate Gaussian
distribution with mean MU and covariance SIGMA.
|
static Matrix |
MultivariateGaussianDistribution.mvnrnd(double[] MU,
double[] SIGMA,
int cases)
Generate random samples chosen from the multivariate Gaussian
distribution with mean MU and a diagonal covariance SIGMA.
|
static Matrix |
MultivariateGaussianDistribution.mvnrnd(Matrix MU,
Matrix SIGMA,
int cases)
Generate random samples chosen from the multivariate Gaussian
distribution with mean MU and covariance SIGMA.
|
| Modifier and Type | Method and Description |
|---|---|
static Matrix |
MultivariateGaussianDistribution.mvnrnd(Matrix MU,
Matrix SIGMA,
int cases)
Generate random samples chosen from the multivariate Gaussian
distribution with mean MU and covariance SIGMA.
|
| Modifier and Type | Method and Description |
|---|---|
static double[] |
STSR.predict(Matrix X) |
static double[] |
FM.predict(Matrix X) |
static double[] |
STSR.predict(Matrix X,
java.lang.String outputFilePath) |
static double[] |
FM.predict(Matrix X,
java.lang.String outputFilePath) |
| Modifier and Type | Method and Description |
|---|---|
Matrix |
RobustPCA.GetErrorMatrix()
Get the error matrix between the original observation matrix
and its low-rank recovered matrix.
|
Matrix |
MatrixCompletion.GetErrorMatrix()
Get the error matrix between the original observation matrix and
its low-rank completed matrix.
|
Matrix |
RobustPCA.GetLowRankEstimation()
Get the low-rank matrix recovered from the corrupted data
observation matrix.
|
Matrix |
MatrixCompletion.GetLowRankEstimation()
Get the low-rank completed matrix.
|
static Matrix[] |
MatrixCompletion.matrixCompletion(Matrix D,
int[] indices)
Do matrix completion which solves the following convex
optimization problem:
min ||A||_*
s.t.
|
static Matrix[] |
MatrixCompletion.matrixCompletion(Matrix D,
Matrix Omega)
Do matrix completion which solves the following convex
optimization problem:
min ||A||_*
s.t.
|
static Matrix[] |
RobustPCA.run(Matrix D,
double lambda)
Compute robust PCA for an observation matrix which solves the
following convex optimization problem:
min ||A||_* + lambda ||E||_1
s.t.
|
| Modifier and Type | Method and Description |
|---|---|
void |
RobustPCA.feedData(Matrix D)
Feed an observation matrix.
|
void |
MatrixCompletion.feedData(Matrix D)
Feed an observation matrix.
|
void |
MatrixCompletion.feedIndices(Matrix Omega)
Feed indices of samples.
|
static Matrix[] |
MatrixCompletion.matrixCompletion(Matrix D,
int[] indices)
Do matrix completion which solves the following convex
optimization problem:
min ||A||_*
s.t.
|
static Matrix[] |
MatrixCompletion.matrixCompletion(Matrix D,
Matrix Omega)
Do matrix completion which solves the following convex
optimization problem:
min ||A||_*
s.t.
|
static Matrix[] |
RobustPCA.run(Matrix D,
double lambda)
Compute robust PCA for an observation matrix which solves the
following convex optimization problem:
min ||A||_* + lambda ||E||_1
s.t.
|
| Modifier and Type | Field and Description |
|---|---|
Matrix |
Regression.W
Unknown parameters represented as a matrix (p x ny).
|
Matrix |
Regression.X
Training data matrix (n x p) with each row being
a data example.
|
Matrix |
Regression.Y
Dependent variable matrix for training (n x ny).
|
| Modifier and Type | Method and Description |
|---|---|
Matrix |
Regression.predict(double[][] Xt)
Predict the dependent variables for test data Xt.
|
Matrix |
Regression.predict(Matrix Xt)
Predict the dependent variables for test data Xt.
|
abstract Matrix |
Regression.train(Matrix X,
Matrix Y)
Train the regression model given independent variable matrix
X and dependent variable matrix Y.
|
Matrix |
LinearRegression.train(Matrix X,
Matrix Y) |
Matrix |
LASSO.train(Matrix X,
Matrix Y) |
abstract Matrix |
Regression.train(Matrix X,
Matrix Y,
Matrix W0)
Train the regression model given independent variable matrix
X, dependent variable matrix Y and the initial weight matrix
W0.
|
Matrix |
LinearRegression.train(Matrix X,
Matrix Y,
Matrix W0) |
Matrix |
LASSO.train(Matrix X,
Matrix Y,
Matrix W0) |
static Matrix |
LASSO.train(Matrix X,
Matrix Y,
Options options) |
| Modifier and Type | Method and Description |
|---|---|
void |
Regression.feedData(Matrix X)
Feed training data for the regression model.
|
void |
Regression.feedDependentVariables(Matrix Y)
Feed training dependent variables for this regression model.
|
Matrix |
Regression.predict(Matrix Xt)
Predict the dependent variables for test data Xt.
|
abstract void |
Regression.train(Matrix W0)
Train the regression model given initial weight matrix W0.
|
void |
LinearRegression.train(Matrix W0) |
void |
LASSO.train(Matrix W0) |
abstract Matrix |
Regression.train(Matrix X,
Matrix Y)
Train the regression model given independent variable matrix
X and dependent variable matrix Y.
|
Matrix |
LinearRegression.train(Matrix X,
Matrix Y) |
Matrix |
LASSO.train(Matrix X,
Matrix Y) |
abstract Matrix |
Regression.train(Matrix X,
Matrix Y,
Matrix W0)
Train the regression model given independent variable matrix
X, dependent variable matrix Y and the initial weight matrix
W0.
|
Matrix |
LinearRegression.train(Matrix X,
Matrix Y,
Matrix W0) |
Matrix |
LASSO.train(Matrix X,
Matrix Y,
Matrix W0) |
static Matrix |
LASSO.train(Matrix X,
Matrix Y,
Options options) |
| Modifier and Type | Method and Description |
|---|---|
void |
CRF.feedData(Matrix[][][] Fs)
Feed data sequences for training.
|
int[] |
CRF.predict(Matrix[][] Fs)
Predict the single best label sequence given the features for an
observation sequence by Viterbi algorithm.
|
| Modifier and Type | Method and Description |
|---|---|
Matrix |
DimensionalityReduction.getDataMatrix() |
Matrix |
DimensionalityReduction.getReducedDataMatrix() |
static Matrix |
PCA.run(Matrix X,
int r)
PCA.
|
static Matrix |
MDS.run(Matrix D,
int p)
Dimensionality reduction by MDS.
|
static Matrix |
KernelPCA.run(Matrix X,
int r)
Kernel PCA.
|
static Matrix |
LLE.run(Matrix X,
int K,
int r)
LLE (Locally Linear Embedding).
|
static Matrix |
Isomap.run(Matrix X,
int K,
int r)
Isomap (isometric feature mapping).
|
| Modifier and Type | Method and Description |
|---|---|
void |
DimensionalityReduction.feedData(Matrix X) |
static Matrix |
PCA.run(Matrix X,
int r)
PCA.
|
static Matrix |
MDS.run(Matrix D,
int p)
Dimensionality reduction by MDS.
|
static Matrix |
KernelPCA.run(Matrix X,
int r)
Kernel PCA.
|
static Matrix |
LLE.run(Matrix X,
int K,
int r)
LLE (Locally Linear Embedding).
|
static Matrix |
Isomap.run(Matrix X,
int K,
int r)
Isomap (isometric feature mapping).
|
| Modifier and Type | Field and Description |
|---|---|
Matrix |
SurvivalScoreModel.T
An n x 1 matrix for the observation time.
|
Matrix |
TemporalLogisticRegression.W
Projection matrix (nFeature x nClass), column i is the projector for class i.
|
Matrix |
SurvivalScoreModel.W |
Matrix |
SurvivalScoreModel.X
An n x p feature matrix.
|
Matrix |
SurvivalScoreModel.Y
An n x 1 matrix for ground truth survival score vector.
|
| Modifier and Type | Method and Description |
|---|---|
Matrix |
TemporalLogisticRegression.predict(Matrix Xt,
Matrix Tt) |
Matrix |
TemporalLASSO.predict(Matrix Xt,
Matrix Tt) |
abstract Matrix |
SurvivalScoreModel.predict(Matrix Xt,
Matrix Tt) |
Matrix |
ReflectedLogisticRegression.predict(Matrix Xt,
Matrix Tt) |
| Modifier and Type | Method and Description |
|---|---|
static double[][] |
SurvivalScoreModel.computeROC(double[] labels,
Matrix Yhat,
int numROCPoints) |
static double[][] |
SurvivalScoreModel.computeROC(int[] scoreArray,
Matrix Yhat,
int numROCPoints) |
static double[][] |
SurvivalScoreModel.computeROC(Matrix Yt,
Matrix Yhat,
int numROCPoints) |
void |
TemporalLogisticRegression.feedData(Matrix X) |
void |
SurvivalScoreModel.feedData(Matrix X) |
void |
TemporalLogisticRegression.feedScore(Matrix V) |
void |
SurvivalScoreModel.feedScore(Matrix Y) |
void |
TemporalLogisticRegression.feedTime(Matrix T) |
void |
SurvivalScoreModel.feedTime(Matrix T) |
Matrix |
TemporalLogisticRegression.predict(Matrix Xt,
Matrix Tt) |
Matrix |
TemporalLASSO.predict(Matrix Xt,
Matrix Tt) |
abstract Matrix |
SurvivalScoreModel.predict(Matrix Xt,
Matrix Tt) |
Matrix |
ReflectedLogisticRegression.predict(Matrix Xt,
Matrix Tt) |
| Modifier and Type | Method and Description |
|---|---|
static Matrix |
Corpus.documents2Matrix(int[][] documents)
Convert a 2D doc-term count array into a matrix.
|
Matrix |
TopicModel.getIndicatorMatrix()
Get the N-by-K topic assignment matrix for this topic model.
|
Matrix |
TopicModel.getTopicMatrix()
Get the V-by-K topic matrix for this topic model.
|
| Modifier and Type | Method and Description |
|---|---|
void |
TopicModel.readCorpus(Matrix dataMatrix)
Read corpus from a V-by-N document-term-count matrix
for this topic model.
|
void |
LDA.readCorpus(Matrix X)
Load
corpus and documents from a RealMatrix instance. |
void |
LdaGibbsSampler.readCorpusFromMatrix(Matrix X)
Load
corpus and documents from a RealMatrix instance. |
void |
Corpus.readCorpusFromMatrix(Matrix X)
Load
corpus and documents from a RealMatrix instance. |
| Modifier and Type | Method and Description |
|---|---|
static Matrix |
Matlab.abs(Matrix A)
Compute element-wise absolute value of all elements of matrix.
|
static Matrix |
Matlab.and(Matrix A,
Matrix B)
Do element by element comparisons between A and B and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static Matrix |
Matlab.cat(int dim,
Matrix... As)
Concatenate matrices along specified dimension.
|
static Matrix |
Matlab.columnVector2ColumnMatrix(Vector V) |
static Matrix |
Matlab.denseColumnVectors2DenseMatrix(Vector[] Vs) |
static Matrix |
Matlab.denseRowVectors2DenseMatrix(Vector[] Vs) |
static Matrix |
Matlab.diag(double[] V)
Generate a diagonal matrix with its elements of a 1D
double
array on its main diagonal. |
static Matrix |
Matlab.diag(Matrix A)
If A is a 1-row or 1-column matrix, then diag(A) is a
sparse diagonal matrix with elements of A as its main diagonal,
else diag(A) is a column matrix holding A's diagonal elements.
|
static Matrix[] |
Matlab.eigs(Matrix A,
int K,
java.lang.String sigma)
Compute eigenvalues and eigenvectors of a symmetric real matrix.
|
static Matrix |
Matlab.eq(double x,
Matrix X)
Do element by element comparisons between X and x and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static Matrix |
Matlab.eq(Matrix X,
double x)
Do element by element comparisons between X and x and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static Matrix |
Matlab.eq(Matrix X,
Matrix Y)
Do element by element comparisons between X and Y and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static Matrix |
Matlab.exp(Matrix A)
Compute the element-wise exponential of a matrix
|
static Matrix |
Matlab.eye(int... size)
Generate a dense identity matrix with its size
specified by a two dimensional integer array.
|
static Matrix |
Matlab.ge(double x,
Matrix X)
Do element by element comparisons between x and X and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static Matrix |
Matlab.ge(Matrix X,
double x)
Do element by element comparisons between X and x and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static Matrix |
Matlab.ge(Matrix X,
Matrix Y)
Do element by element comparisons between X and Y and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static Matrix |
Matlab.getColumns(Matrix A,
int... selectedColumns)
Get the subMatrix containing the elements of the specified columns.
|
static Matrix |
Matlab.getColumns(Matrix A,
int startColumn,
int endColumn)
Get the subMatrix containing the elements of the specified columns.
|
static Matrix |
Matlab.getRows(Matrix A,
int... selectedRows)
Get the subMatrix containing the elements of the specified rows.
|
static Matrix |
Matlab.getRows(Matrix A,
int startRow,
int endRow)
Get the subMatrix containing the elements of the specified rows.
|
static Matrix |
Matlab.getTFIDF(Matrix docTermCountMatrix)
Calculate TFIDF of a doc-term-count matrix, each column
is a data sample.
|
static Matrix |
Matlab.gt(double x,
Matrix X)
Do element by element comparisons between x and X and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static Matrix |
Matlab.gt(Matrix X,
double x)
Do element by element comparisons between X and x and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static Matrix |
Matlab.gt(Matrix X,
Matrix Y)
Do element by element comparisons between X and Y and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static Matrix |
Matlab.hilb(int m,
int n)
Create a m-by-n Hilbert matrix.
|
static Matrix |
Matlab.horzcat(Matrix... As)
Concatenate matrices horizontally.
|
static Matrix |
Matlab.inv(Matrix A)
Compute the inverse of a real square matrix.
|
static Matrix |
Matlab.isinf(Matrix A)
returns an array that contains 1's where the
elements of X are +Inf or -Inf and 0's where they are not.
|
static Matrix |
Matlab.isnan(Matrix A)
Returns an array that contains 1's where
the elements of X are NaN's and 0's where they are not.
|
static Matrix |
Matlab.kron(Matrix A,
Matrix B)
Compute the Kronecker tensor product of A and B
|
static Matrix |
Matlab.l2Distance(Matrix X,
Matrix Y)
Compute the l2 distance matrix between row vectors in matrix X
and row vectors in matrix Y.
|
static Matrix |
Matlab.l2Distance(Vector[] X,
Vector[] Y)
Compute the l2 distance matrix between two sets of vectors X and Y.
|
static Matrix |
Matlab.l2DistanceByColumns(Matrix X,
Matrix Y)
Compute the l2 distance matrix between column vectors in matrix X
and column vectors in matrix Y.
|
static Matrix |
Matlab.l2DistanceSquare(Matrix X,
Matrix Y)
Compute the squared l2 distance matrix between row vectors in matrix X
and row vectors in matrix Y.
|
static Matrix |
Matlab.l2DistanceSquare(Vector[] X,
Vector[] Y)
Compute the squared l2 distance matrix between two sets of vectors X and Y.
|
static Matrix |
Matlab.l2DistanceSquare0(Matrix X,
Matrix Y)
Deprecated.
|
static Matrix |
Matlab.l2DistanceSquareByColumns(Matrix X,
Matrix Y)
Compute the squared l2 distance matrix between column vectors in matrix X
and column vectors in matrix Y.
|
static Matrix |
Matlab.le(double x,
Matrix X)
Do element by element comparisons between x and X and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static Matrix |
Matlab.le(Matrix X,
double x)
Do element by element comparisons between X and x and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static Matrix |
Matlab.le(Matrix X,
Matrix Y)
Do element by element comparisons between X and Y and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static Matrix |
Matlab.linearIndexing(Matrix A,
int[] indices)
Linear indexing A by an index array.
|
static Matrix |
Matlab.logicalIndexing(Matrix A,
Matrix B)
Logical indexing A by B for the syntax A(B).
|
static Matrix |
Matlab.lt(double x,
Matrix X)
Do element by element comparisons between x and X and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static Matrix |
Matlab.lt(Matrix X,
double x)
Do element by element comparisons between X and x and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static Matrix |
Matlab.lt(Matrix X,
Matrix Y)
Do element by element comparisons between X and Y and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static Matrix |
Matlab.max(double v,
Matrix A)
Compute maximum between elements of A and a real number and return
as a matrix with the same shape of A.
|
static Matrix |
Matlab.max(Matrix A,
double v)
Compute maximum between elements of A and a real number and return
as a matrix with the same shape of A.
|
static Matrix |
Matlab.max(Matrix A,
Matrix B)
Compute maximum between two real matrices A and B.
|
static Matrix |
Matlab.min(double v,
Matrix A)
Compute minimum between elements of A and a real number and return
as a matrix with the same shape of A.
|
static Matrix |
Matlab.min(Matrix A,
double v)
Compute minimum between elements of A and a real number and return
as a matrix with the same shape of A.
|
static Matrix |
Matlab.min(Matrix A,
Matrix B)
Compute minimum between two real matrices A and B.
|
static Matrix |
Matlab.minus(double v,
Matrix A)
res = v - A.
|
static Matrix |
Matlab.minus(Matrix A,
double v) |
static Matrix |
Matlab.minus(Matrix M1,
Matrix M2) |
static Matrix |
Matlab.mldivide(Matrix A,
Matrix B)
Calculate the left division of the form A \ B.
|
static Matrix |
Matlab.mrdivide(Matrix A,
Matrix B)
Calculate the right division of B into A, i.e., A / B.
|
static Matrix |
Matlab.mtimes(Matrix M1,
Matrix M2) |
static Matrix |
Matlab.mvnrnd(double[] MU,
double[][] SIGMA,
int cases)
Generate random samples chosen from the multivariate Gaussian
distribution with mean MU and covariance SIGMA.
|
static Matrix |
Matlab.mvnrnd(double[] MU,
double[] SIGMA,
int cases)
Generate random samples chosen from the multivariate Gaussian
distribution with mean MU and a diagonal covariance SIGMA.
|
static Matrix |
Matlab.mvnrnd(Matrix MU,
Matrix SIGMA,
int cases)
Generate random samples chosen from the multivariate Gaussian
distribution with mean MU and covariance SIGMA.
|
static Matrix |
Matlab.ne(double x,
Matrix X)
Do element by element comparisons between X and x and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static Matrix |
Matlab.ne(Matrix X,
double x)
Do element by element comparisons between X and x and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static Matrix |
Matlab.ne(Matrix X,
Matrix Y)
Do element by element comparisons between X and Y and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static Matrix |
Matlab.normalizeByColumns(Matrix A)
Normalize A by columns.
|
static Matrix |
Matlab.not(Matrix A)
Performs a logical NOT of input array A, and returns an array
containing elements set to either 1 (TRUE) or 0 (FALSE).
|
static Matrix |
Matlab.ones(int n)
Generate an n by n all one matrix.
|
static Matrix |
Matlab.ones(int[] size)
Generate an all one matrix with its size
specified by a two dimensional integer array.
|
static Matrix |
Matlab.ones(int nRow,
int nCol)
Generate an all one matrix with nRow rows and nCol columns.
|
static Matrix |
Matlab.or(Matrix A,
Matrix B)
Do element by element comparisons between A and B and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static Matrix |
Matlab.plus(double v,
Matrix A) |
static Matrix |
Matlab.plus(Matrix A,
double v) |
static Matrix |
Matlab.plus(Matrix M1,
Matrix M2) |
static Matrix |
Matlab.pow(Matrix A,
double p)
Compute element-wise exponentiation of a vector.
|
static Matrix |
Matlab.rand(int n)
Generate an n-by-n matrix containing pseudo-random values drawn
from the standard uniform distribution on the open interval (0,1).
|
static Matrix |
Matlab.rand(int nRow,
int nCol)
Generate an nRow-by-nCol matrix containing pseudo-random values drawn
from the standard uniform distribution on the open interval (0,1).
|
static Matrix |
Matlab.randn(int n)
Generate an n-by-n matrix containing pseudo-random values drawn
from the standard normal distribution.
|
static Matrix |
Matlab.randn(int nRow,
int nCol)
Generate an nRow-by-nCol matrix containing pseudo-random values drawn
from the standard normal distribution.
|
static Matrix |
Matlab.rdivide(Matrix A,
double v)
Right array division.
|
static Matrix |
Matlab.repmat(Matrix A,
int[] size)
Replicate and tile an array.
|
static Matrix |
Matlab.repmat(Matrix A,
int M,
int N)
Replicate and tile an array.
|
static Matrix |
Matlab.reshape(Matrix A,
int[] size)
Reshape a matrix to a new shape specified by a two dimensional
integer array.
|
static Matrix |
Matlab.reshape(Matrix A,
int M,
int N)
Reshape a matrix to a new shape specified number of rows and
columns.
|
static Matrix |
Matlab.reshape(Vector V,
int[] size)
Reshape a vector to a matrix with a shape specified by a two dimensional
integer array.
|
static Matrix |
Matlab.reshape(Vector V,
int M,
int N)
Reshape a vector to a new shape specified number of rows and
columns.
|
static Matrix |
Matlab.rowVector2RowMatrix(Vector V) |
static Matrix |
Matlab.sigmoid(Matrix A)
Calculate the sigmoid of a matrix A by rows.
|
static Matrix |
Matlab.sign(Matrix A)
Signum function.
|
static Matrix[] |
Matlab.sort(Matrix A)
Sort elements of a matrix A by columns in an increasing order.
|
static Matrix[] |
Matlab.sort(Matrix A,
int dim)
Sort elements of a matrix A on a direction in an increasing order.
|
static Matrix[] |
Matlab.sort(Matrix A,
int dim,
java.lang.String order)
Sort elements of a matrix A on a direction in a specified order.
|
static Matrix[] |
Matlab.sort(Matrix A,
java.lang.String order)
Sort elements of a matrix A by columns in a specified order.
|
static Matrix |
Matlab.sparseColumnVectors2SparseMatrix(Vector[] Vs) |
static Matrix |
Matlab.sparseRowVectors2SparseMatrix(Vector[] Vs) |
static Matrix |
Matlab.speye(int... size)
Generate a sparse identity matrix with its size
specified by a two dimensional integer array.
|
static Matrix |
Matlab.sqrt(Matrix A)
Calculate square root for all elements of a matrix A.
|
static Matrix |
Matlab.subplus(Matrix A)
Get the nonnegative part of a matrix A.
|
static Matrix[] |
Matlab.svd(Matrix A)
Compute the "economy size" matrix singular value decomposition.
|
static Matrix |
Matlab.times(double v,
Matrix A) |
static Matrix |
Matlab.times(Matrix A,
double v) |
static Matrix |
Matlab.times(Matrix X,
Matrix Y) |
static Matrix |
Matlab.uminus(Matrix A)
Unary minus.
|
static Matrix |
Matlab.vec(Matrix A)
Vectorize a matrix A.
|
static Matrix |
Matlab.vertcat(Matrix... As)
Concatenate matrices vertically.
|
static Matrix |
Matlab.zeros(int n)
Generate an n by n all zero matrix.
|
static Matrix |
Matlab.zeros(int[] size)
Generate an all zero matrix with its size
specified by a two dimensional integer array.
|
static Matrix |
Matlab.zeros(int nRow,
int nCol)
Generate nRow by nCol all zero matrix.
|
| Modifier and Type | Method and Description |
|---|---|
static Matrix |
Matlab.abs(Matrix A)
Compute element-wise absolute value of all elements of matrix.
|
static void |
InPlaceOperator.abs(Matrix res,
Matrix A)
res = abs(A).
|
static void |
InPlaceOperator.affine(Matrix res,
double a,
Matrix A,
char operator,
Matrix B)
res = a * A + B if operator is '+',
res = a * A - B if operator is '-'.
|
static void |
InPlaceOperator.affine(Matrix res,
double a,
Matrix A,
double b)
res = a * A + b
|
static void |
InPlaceOperator.affine(Matrix res,
double a,
Matrix A,
double b,
Matrix B)
res = a * A + b * B
|
static void |
InPlaceOperator.affine(Matrix res,
Matrix A,
double b,
Matrix B)
res = A + b * B
|
static void |
InPlaceOperator.affine(Matrix res,
Matrix A,
Matrix B,
char operator,
Matrix C)
res = A * B + C if operator is '+',
res = A * B - C if operator is '-'.
|
static void |
InPlaceOperator.affine(Matrix res,
Matrix A,
Matrix B,
double v)
res = A * B + v
|
static void |
InPlaceOperator.affine(Matrix res,
Matrix A,
Matrix B,
double v,
Matrix C)
res = A * B + v * C
|
static Matrix |
Matlab.and(Matrix A,
Matrix B)
Do element by element comparisons between A and B and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static void |
InPlaceOperator.assign(Matrix res,
Matrix A)
res = A
|
static Matrix |
Matlab.cat(int dim,
Matrix... As)
Concatenate matrices along specified dimension.
|
static void |
InPlaceOperator.clear(Matrix res)
Clear the input matrix.
|
static Vector[] |
Matlab.denseMatrix2DenseColumnVectors(Matrix A) |
static Vector[] |
Matlab.denseMatrix2DenseRowVectors(Matrix A) |
static double |
Matlab.det(Matrix A)
Compute the determinant of a real square matrix.
|
static Matrix |
Matlab.diag(Matrix A)
If A is a 1-row or 1-column matrix, then diag(A) is a
sparse diagonal matrix with elements of A as its main diagonal,
else diag(A) is a column matrix holding A's diagonal elements.
|
static void |
Printer.disp(Matrix A)
Display a matrix.
|
static void |
Printer.disp(Matrix A,
int p)
Display a matrix with specified precision.
|
static void |
Printer.display(Matrix A)
Display a matrix.
|
static void |
Printer.display(Matrix A,
int p)
Display a matrix with specified precision.
|
static void |
InPlaceOperator.divide(Matrix res,
double v)
res = v \ res
|
static Matrix[] |
Matlab.eigs(Matrix A,
int K,
java.lang.String sigma)
Compute eigenvalues and eigenvectors of a symmetric real matrix.
|
static Matrix |
Matlab.eq(double x,
Matrix X)
Do element by element comparisons between X and x and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static Matrix |
Matlab.eq(Matrix X,
double x)
Do element by element comparisons between X and x and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static Matrix |
Matlab.eq(Matrix X,
Matrix Y)
Do element by element comparisons between X and Y and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static Matrix |
Matlab.exp(Matrix A)
Compute the element-wise exponential of a matrix
|
static void |
InPlaceOperator.exp(Matrix res,
Matrix A)
res = exp(A).
|
static void |
InPlaceOperator.expAssign(Matrix res)
res = exp(res).
|
static FindResult |
Matlab.find(Matrix A)
Find nonzero elements and return their value, row and column indices.
|
static DenseMatrix |
Matlab.full(Matrix S) |
static Matrix |
Matlab.ge(double x,
Matrix X)
Do element by element comparisons between x and X and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static Matrix |
Matlab.ge(Matrix X,
double x)
Do element by element comparisons between X and x and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static Matrix |
Matlab.ge(Matrix X,
Matrix Y)
Do element by element comparisons between X and Y and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static Matrix |
Matlab.getColumns(Matrix A,
int... selectedColumns)
Get the subMatrix containing the elements of the specified columns.
|
static Matrix |
Matlab.getColumns(Matrix A,
int startColumn,
int endColumn)
Get the subMatrix containing the elements of the specified columns.
|
static Matrix |
Matlab.getRows(Matrix A,
int... selectedRows)
Get the subMatrix containing the elements of the specified rows.
|
static Matrix |
Matlab.getRows(Matrix A,
int startRow,
int endRow)
Get the subMatrix containing the elements of the specified rows.
|
static Matrix |
Matlab.getTFIDF(Matrix docTermCountMatrix)
Calculate TFIDF of a doc-term-count matrix, each column
is a data sample.
|
static Matrix |
Matlab.gt(double x,
Matrix X)
Do element by element comparisons between x and X and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static Matrix |
Matlab.gt(Matrix X,
double x)
Do element by element comparisons between X and x and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static Matrix |
Matlab.gt(Matrix X,
Matrix Y)
Do element by element comparisons between X and Y and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static Matrix |
Matlab.horzcat(Matrix... As)
Concatenate matrices horizontally.
|
static double |
Matlab.innerProduct(Matrix A,
Matrix B)
Compute the inner product of two matrices, i.e.
|
static Matrix |
Matlab.inv(Matrix A)
Compute the inverse of a real square matrix.
|
static Matrix |
Matlab.isinf(Matrix A)
returns an array that contains 1's where the
elements of X are +Inf or -Inf and 0's where they are not.
|
static Matrix |
Matlab.isnan(Matrix A)
Returns an array that contains 1's where
the elements of X are NaN's and 0's where they are not.
|
static Matrix |
Matlab.kron(Matrix A,
Matrix B)
Compute the Kronecker tensor product of A and B
|
static Matrix |
Matlab.l2Distance(Matrix X,
Matrix Y)
Compute the l2 distance matrix between row vectors in matrix X
and row vectors in matrix Y.
|
static Vector |
Matlab.l2Distance(Vector V,
Matrix Y)
Compute the l2 distance vector between a vector V
and row vectors in matrix Y.
|
static Matrix |
Matlab.l2DistanceByColumns(Matrix X,
Matrix Y)
Compute the l2 distance matrix between column vectors in matrix X
and column vectors in matrix Y.
|
static Matrix |
Matlab.l2DistanceSquare(Matrix X,
Matrix Y)
Compute the squared l2 distance matrix between row vectors in matrix X
and row vectors in matrix Y.
|
static Vector |
Matlab.l2DistanceSquare(Vector V,
Matrix Y)
Compute the squared l2 distance vector between a vector V
and row vectors in matrix Y.
|
static Matrix |
Matlab.l2DistanceSquare0(Matrix X,
Matrix Y)
Deprecated.
|
static Matrix |
Matlab.l2DistanceSquareByColumns(Matrix X,
Matrix Y)
Compute the squared l2 distance matrix between column vectors in matrix X
and column vectors in matrix Y.
|
static Matrix |
Matlab.le(double x,
Matrix X)
Do element by element comparisons between x and X and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static Matrix |
Matlab.le(Matrix X,
double x)
Do element by element comparisons between X and x and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static Matrix |
Matlab.le(Matrix X,
Matrix Y)
Do element by element comparisons between X and Y and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static Matrix |
Matlab.linearIndexing(Matrix A,
int[] indices)
Linear indexing A by an index array.
|
static void |
Matlab.linearIndexingAssignment(Matrix A,
int[] idx,
double v)
Matrix assignment by linear indexing for the syntax A(B) = v.
|
static void |
Matlab.linearIndexingAssignment(Matrix A,
int[] idx,
Matrix V)
Matrix assignment by linear indexing for the syntax A(B) = V.
|
static DenseMatrix |
Matlab.log(Matrix A)
Calculate the element-wise logarithm of a matrix.
|
static void |
InPlaceOperator.log(Matrix res,
Matrix A)
res = log(A).
|
static void |
InPlaceOperator.logAssign(Matrix res)
res = log(res).
|
static Matrix |
Matlab.logicalIndexing(Matrix A,
Matrix B)
Logical indexing A by B for the syntax A(B).
|
static void |
Matlab.logicalIndexingAssignment(Matrix A,
Matrix B,
double v)
Matrix assignment by logical indexing for the syntax A(B) = v.
|
static void |
Matlab.logicalIndexingAssignment(Matrix A,
Matrix B,
Matrix V)
Matrix assignment by logical indexing for the syntax A(B) = V.
|
static Matrix |
Matlab.lt(double x,
Matrix X)
Do element by element comparisons between x and X and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static Matrix |
Matlab.lt(Matrix X,
double x)
Do element by element comparisons between X and x and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static Matrix |
Matlab.lt(Matrix X,
Matrix Y)
Do element by element comparisons between X and Y and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static Matrix |
Matlab.max(double v,
Matrix A)
Compute maximum between elements of A and a real number and return
as a matrix with the same shape of A.
|
static Vector[] |
Matlab.max(Matrix A)
Compute the maximal value for each column and the
corresponding row indices of a matrix A.
|
static Matrix |
Matlab.max(Matrix A,
double v)
Compute maximum between elements of A and a real number and return
as a matrix with the same shape of A.
|
static Vector[] |
Matlab.max(Matrix A,
int dim)
Compute the maximal value for each row or each column
and the corresponding indices of a matrix A.
|
static Matrix |
Matlab.max(Matrix A,
Matrix B)
Compute maximum between two real matrices A and B.
|
static DenseVector |
Matlab.mean(Matrix X,
int dim)
M = mean(A, dim) returns the mean values for elements
along the dimension of A specified by scalar dim.
|
static Matrix |
Matlab.min(double v,
Matrix A)
Compute minimum between elements of A and a real number and return
as a matrix with the same shape of A.
|
static Vector[] |
Matlab.min(Matrix A)
Compute the minimal value for each column and the
corresponding row indices of a matrix A.
|
static Matrix |
Matlab.min(Matrix A,
double v)
Compute minimum between elements of A and a real number and return
as a matrix with the same shape of A.
|
static Vector[] |
Matlab.min(Matrix A,
int dim)
Compute the minimal value for each row or each column
and the corresponding indices of a matrix A.
|
static Matrix |
Matlab.min(Matrix A,
Matrix B)
Compute minimum between two real matrices A and B.
|
static Matrix |
Matlab.minus(double v,
Matrix A)
res = v - A.
|
static Matrix |
Matlab.minus(Matrix A,
double v) |
static void |
InPlaceOperator.minus(Matrix res,
double v,
Matrix A)
res = v - A
|
static Matrix |
Matlab.minus(Matrix M1,
Matrix M2) |
static void |
InPlaceOperator.minus(Matrix res,
Matrix A,
double v)
res = A - v
|
static void |
InPlaceOperator.minus(Matrix res,
Matrix A,
Matrix B)
res = A - B
|
static void |
InPlaceOperator.minusAssign(Matrix res,
double v)
res = res - v
|
static void |
InPlaceOperator.minusAssign(Matrix res,
double a,
Matrix A)
res -= a * A.
|
static void |
InPlaceOperator.minusAssign(Matrix res,
Matrix A)
res = res - A
|
static Matrix |
Matlab.mldivide(Matrix A,
Matrix B)
Calculate the left division of the form A \ B.
|
static Matrix |
Matlab.mrdivide(Matrix A,
Matrix B)
Calculate the right division of B into A, i.e., A / B.
|
static Matrix |
Matlab.mtimes(Matrix M1,
Matrix M2) |
static void |
InPlaceOperator.mtimes(Matrix res,
Matrix A,
char operator,
Matrix B)
res = A * B if operator is ' ',
res = AT * B if operator is 'T'.
|
static void |
InPlaceOperator.mtimes(Matrix res,
Matrix A,
Matrix B)
res = A * B.
|
static Matrix |
Matlab.mvnrnd(Matrix MU,
Matrix SIGMA,
int cases)
Generate random samples chosen from the multivariate Gaussian
distribution with mean MU and covariance SIGMA.
|
static Matrix |
Matlab.ne(double x,
Matrix X)
Do element by element comparisons between X and x and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static Matrix |
Matlab.ne(Matrix X,
double x)
Do element by element comparisons between X and x and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static Matrix |
Matlab.ne(Matrix X,
Matrix Y)
Do element by element comparisons between X and Y and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static double |
Matlab.norm(Matrix A)
Compute the Euclidean norm of a matrix.
|
static double |
Matlab.norm(Matrix A,
double type)
Compute the induced vector norm of a matrix (row or column
matrices are allowed).
|
static double |
Matlab.norm(Matrix A,
int type)
Compute the norm of a matrix (row or column matrices
are allowed).
|
static double |
Matlab.norm(Matrix A,
java.lang.String type)
Calculate the Frobenius norm of a matrix A.
|
static Matrix |
Matlab.normalizeByColumns(Matrix A)
Normalize A by columns.
|
static Matrix |
Matlab.not(Matrix A)
Performs a logical NOT of input array A, and returns an array
containing elements set to either 1 (TRUE) or 0 (FALSE).
|
static void |
InPlaceOperator.operate(Vector res,
Matrix A,
Vector V)
res = A * V.
|
static void |
InPlaceOperator.operate(Vector res,
Vector V,
Matrix A)
res' = V' * A.
|
static Matrix |
Matlab.or(Matrix A,
Matrix B)
Do element by element comparisons between A and B and returns
a matrix of the same size with elements set to 1 where the
relation is true and elements set to 0 where it is not.
|
static void |
InPlaceOperator.or(Matrix res,
Matrix A,
Matrix B)
res = A | B.
|
static Matrix |
Matlab.plus(double v,
Matrix A) |
static Matrix |
Matlab.plus(Matrix A,
double v) |
static Matrix |
Matlab.plus(Matrix M1,
Matrix M2) |
static void |
InPlaceOperator.plus(Matrix res,
Matrix A,
double v)
res = A + v;
|
static void |
InPlaceOperator.plus(Matrix res,
Matrix A,
Matrix B)
res = A + B
|
static void |
InPlaceOperator.plusAssign(Matrix res,
double v)
res = res + v
|
static void |
InPlaceOperator.plusAssign(Matrix res,
double a,
Matrix A)
res += a * A.
|
static void |
InPlaceOperator.plusAssign(Matrix res,
Matrix A)
res = res + A
|
static Matrix |
Matlab.pow(Matrix A,
double p)
Compute element-wise exponentiation of a vector.
|
static void |
Printer.printDenseMatrix(Matrix A)
Print a dense matrix.
|
static void |
Printer.printDenseMatrix(Matrix A,
int p)
Print a dense matrix with specified precision.
|
static void |
Printer.printMatrix(Matrix A)
Print a matrix.
|
static void |
Printer.printMatrix(Matrix A,
int p)
Print a matrix with specified precision.
|
static void |
Printer.printSparseMatrix(Matrix A)
Print a sparse matrix.
|
static void |
Printer.printSparseMatrix(Matrix A,
int p)
Print a sparse matrix with specified precision.
|
static int |
Matlab.rank(Matrix A)
Compute the rank of a matrix.
|
static Matrix |
Matlab.rdivide(Matrix A,
double v)
Right array division.
|
static void |
InPlaceOperator.rdivideAssign(Matrix res,
double v)
res = res / v
|
static Matrix |
Matlab.repmat(Matrix A,
int[] size)
Replicate and tile an array.
|
static Matrix |
Matlab.repmat(Matrix A,
int M,
int N)
Replicate and tile an array.
|
static Matrix |
Matlab.reshape(Matrix A,
int[] size)
Reshape a matrix to a new shape specified by a two dimensional
integer array.
|
static Matrix |
Matlab.reshape(Matrix A,
int M,
int N)
Reshape a matrix to a new shape specified number of rows and
columns.
|
static void |
Matlab.setMatrix(Matrix X,
Matrix Y)
Set all the elements of X to be those of Y, this is particularly
useful when we want to change elements of the object referred by X
rather than the reference X itself.
|
static void |
Matlab.setSubMatrix(Matrix A,
int[] selectedRows,
int[] selectedColumns,
Matrix B)
Set submatrix of A with selected rows and selected columns by elements of B.
|
static Matrix |
Matlab.sigmoid(Matrix A)
Calculate the sigmoid of a matrix A by rows.
|
static void |
InPlaceOperator.sigmoid(Matrix res,
Matrix A)
Calculate the sigmoid of a matrix A by rows.
|
static Matrix |
Matlab.sign(Matrix A)
Signum function.
|
static int[] |
Matlab.size(Matrix A)
Get a two dimensional integer array for size of a matrix A.
|
static int |
Matlab.size(Matrix A,
int dim)
Get the dimensionality on dim-th dimension for a matrix A.
|
static Matrix[] |
Matlab.sort(Matrix A)
Sort elements of a matrix A by columns in an increasing order.
|
static Matrix[] |
Matlab.sort(Matrix A,
int dim)
Sort elements of a matrix A on a direction in an increasing order.
|
static Matrix[] |
Matlab.sort(Matrix A,
int dim,
java.lang.String order)
Sort elements of a matrix A on a direction in a specified order.
|
static Matrix[] |
Matlab.sort(Matrix A,
java.lang.String order)
Sort elements of a matrix A by columns in a specified order.
|
static SparseMatrix |
Matlab.sparse(Matrix A) |
static Vector[] |
Matlab.sparseMatrix2SparseColumnVectors(Matrix S) |
static Vector[] |
Matlab.sparseMatrix2SparseRowVectors(Matrix S) |
static Matrix |
Matlab.sqrt(Matrix A)
Calculate square root for all elements of a matrix A.
|
static DenseVector |
Matlab.std(Matrix X)
Compute standard deviation for columns of a real matrix with
n - 1 in the divisor.
|
static DenseVector |
Matlab.std(Matrix X,
int flag)
Compute standard deviation for columns of a real matrix.
|
static DenseVector |
Matlab.std(Matrix X,
int flag,
int dim)
Compute standard deviation.
|
static Matrix |
Matlab.subplus(Matrix A)
Get the nonnegative part of a matrix A.
|
static void |
InPlaceOperator.subplus(Matrix res,
Matrix A)
res = subplus(A).
|
static void |
InPlaceOperator.subplusAssign(Matrix res)
res = subplus(res).
|
static DenseVector |
Matlab.sum(Matrix A)
Compute the sum of elements for each row of a real matrix.
|
static DenseVector |
Matlab.sum(Matrix A,
int dim)
Compute the sum of elements for each row or each column of
a real matrix.
|
static double |
Matlab.sumAll(Matrix A)
Compute the sum of all elements of a matrix.
|
static Matrix[] |
Matlab.svd(Matrix A)
Compute the "economy size" matrix singular value decomposition.
|
static Matrix |
Matlab.times(double v,
Matrix A) |
static Matrix |
Matlab.times(Matrix A,
double v) |
static void |
InPlaceOperator.times(Matrix res,
double v,
Matrix A)
res = v * A
|
static Matrix |
Matlab.times(Matrix X,
Matrix Y) |
static void |
InPlaceOperator.times(Matrix res,
Matrix A,
Matrix B)
res = A .* B
|
static void |
InPlaceOperator.timesAssign(Matrix res,
double v)
res = v * res
|
static void |
InPlaceOperator.timesAssign(Matrix res,
Matrix A)
res = res .* A
|
static Matrix |
Matlab.uminus(Matrix A)
Unary minus.
|
static void |
InPlaceOperator.uminus(Matrix res,
Matrix A)
res = -A
|
static void |
InPlaceOperator.uminusAssign(Matrix res)
res = -res
|
static Matrix |
Matlab.vec(Matrix A)
Vectorize a matrix A.
|
static Matrix |
Matlab.vertcat(Matrix... As)
Concatenate matrices vertically.
|


I opened MultiBit and my wallets were missing
What are the symptoms ?
You open MultiBit and instead of seeing your wallet(s) in the Wallet list, you don't see anything. The wallet(s) have probably just been closed.
What can you do when this happens ?
Relax - you are very likely to still have your wallet(s) on your disk. Do the following:
- Review Troubleshooting. This describes where MultiBit stores the default wallet (multibit.wallet) for your computer.
- Have a look in that directory. You can open any wallet there using the 'File |
Open Wallet' menu option.
- Use your computer's search tool to find ".wallet" and include hidden directories - you should see the automatically generated backups.
- If you created a new wallet and stored it in another directory then you will have to look there.
- Check any external/network drives you may have chosen when saving the wallet


2 Samuel 15:33
Unto whom David said, If thou passest on with me, then thou shalt be a burden unto me:


Mariposa Joining Form
Click here for more info on the benefits of Mariposa Food Co-op Membership!
Your signup is complete! We look forward to seeing you at your orientation. If you are not able to attend any of our upcoming orientations, our member coordinator will contact you with additional options as more orientation dates become available.


A tool for importing, visualizing, and analyzing the soil carbon database created by the Powell Center working group.
| Version: | 1.2.0 |
| Depends: | R (≥ 3.3.2) |
| Imports: | openxlsx, devtools, ggplot2, shiny |
| Suggests: | knitr, rmarkdown |
| Published: | 2017-08-04 |
| Author: | J Grey Monroe [aut, cre] |
| Maintainer: | J Grey Monroe <greymonroe at gmail.com> |
| BugReports: | https://github.com/powellcenter-soilcarbon/soilcarbon/issues |
| License: | GPL-2 |
| URL: | https://powellcenter-soilcarbon.github.io/soilcarbon/ |
| NeedsCompilation: | no |
| Materials: | README NEWS |
| CRAN checks: | soilcarbon results |
| Reference manual: | soilcarbon.pdf |
| Vignettes: |
Launch shiny app |
| Package source: | soilcarbon_1.2.0.tar.gz |
| Windows binaries: | r-devel: soilcarbon_1.2.0.zip, r-release: soilcarbon_1.2.0.zip, r-oldrel: soilcarbon_1.2.0.zip |
| OS X binaries: | r-release: soilcarbon_1.2.0.tgz, r-oldrel: soilcarbon_1.2.0.tgz |
| Old sources: | soilcarbon archive |
Please use the canonical form https://CRAN.R-project.org/package=soilcarbon to link to this page.


The base code generator is bare-bones. It sets up the source and destination paths and tells the logger whether to keep its trap shut.
It‘s useful for copying files such as stylesheets, images, or javascripts.
For more comprehensive template-based passive code generation with arguments, you‘ll want Rails::Generator::NamedBase.
Generators create a manifest of the actions they perform then hand the manifest to a command which replays the actions to do the heavy lifting (such as checking for existing files or creating directories if needed). Create, destroy, and list commands are included. Since a single manifest may be used by any command, creating new generators is as simple as writing some code templates and declaring what you‘d like to do with them.
The manifest method must be implemented by subclasses, returning a Rails::Generator::Manifest. The record method is provided as a convenience for manifest creation. Example:
class StylesheetGenerator < Rails::Generator::Base def manifest record do |m| m.directory('public/stylesheets') m.file('application.css', 'public/stylesheets/application.css') end end end
See Rails::Generator::Commands::Create for a list of methods available to the manifest.
| [R] | args | |
| [R] | destination_root | |
| [R] | source_root |
[ show source ]
# File vendor/rails/railties/lib/rails_generator/base.rb, line 101 101: def initialize(runtime_args, runtime_options = {}) 102: @args = runtime_args 103: parse!(@args, runtime_options) 104: 105: # Derive source and destination paths. 106: @source_root = options[:source] || File.join(spec.path, 'templates') 107: if options[:destination] 108: @destination_root = options[:destination] 109: elsif defined? ::RAILS_ROOT 110: @destination_root = ::RAILS_ROOT 111: end 112: 113: # Silence the logger if requested. 114: logger.quiet = options[:quiet] 115: 116: # Raise usage error if help is requested. 117: usage if options[:help] 118: end
[ show source ]
# File vendor/rails/railties/lib/rails_generator/base.rb, line 157 157: def after_generate 158: end
Return the full path from the destination root for the given path. Example for destination_root = ’/dest’:
destination_path('some/path.rb') == '/dest/some/path.rb'
[ show source ]
# File vendor/rails/railties/lib/rails_generator/base.rb, line 153 153: def destination_path(relative_destination) 154: File.join(destination_root, relative_destination) 155: end
Generators must provide a manifest. Use the record method to create a new manifest and record your generator‘s actions.
[ show source ]
# File vendor/rails/railties/lib/rails_generator/base.rb, line 122 122: def manifest 123: raise NotImplementedError, "No manifest for '#{spec.name}' generator." 124: end
Return the full path from the source root for the given path. Example for source_root = ’/source’:
source_path('some/path.rb') == '/source/some/path.rb'
The given path may include a colon ’:’ character to indicate that the file belongs to another generator. This notation allows any generator to borrow files from another. Example:
source_path('model:fixture.yml') = '/model/source/path/fixture.yml'
[ show source ]
# File vendor/rails/railties/lib/rails_generator/base.rb, line 134 134: def source_path(relative_source) 135: # Check whether we're referring to another generator's file. 136: name, path = relative_source.split(':', 2) 137: 138: # If not, return the full path to our source file. 139: if path.nil? 140: File.join(source_root, name) 141: 142: # Otherwise, ask our referral for the file. 143: else 144: # FIXME: this is broken, though almost always true. Others' 145: # source_root are not necessarily the templates dir. 146: File.join(self.class.lookup(name).path, 'templates', path) 147: end 148: end
Override with your own usage banner.
[ show source ]
# File vendor/rails/railties/lib/rails_generator/base.rb, line 167 167: def banner 168: "Usage: #{$0} #{spec.name} [options]" 169: end
[ show source ]
# File vendor/rails/railties/lib/rails_generator/base.rb, line 162 162: def record 163: Rails::Generator::Manifest.new(self) { |m| yield m } 164: end
Read USAGE from file in generator base path.
[ show source ]
# File vendor/rails/railties/lib/rails_generator/base.rb, line 172 172: def usage_message 173: File.read(File.join(spec.path, 'USAGE')) rescue '' 174: end


'Significant number' of police sent to Spain's Catalonia ahead of election: PM
MADRID: A "significant number" of security forces will be sent to Catalonia ahead of Sunday's parliamentary elections to make sure that protests that have rocked the Spanish region do not disrupt the vote, acting Prime Minister Pedro Sanchez said on Wednesday (Nov 6).
Catalan separatism, and the weeks of protests that erupted in the regional capital Barcelona following the sentencing of nine independence leaders to jail mid-October, have been thrust into the spotlight again as Spain gears up for its fourth election in four years.
Authorities have been bracing for pro-independence protests on the eve of the vote that could potentially turn violent, government and Socialist party sources had told Reuters last week.
"Logically, we have deployed a significant number of state security forces to ensure normality on a day in which citizens and their vote must be the protagonists," Sanchez told public broadcaster RNE.
A spokesman for the national police in Barcelona said anti-riot police had been deployed to Catalonia in order to "reinforce in the event of potential unrest, such as blocking polling stations" but added that regional police will be tasked with keeping order on the day, with the national police prepared only to step in if asked.
The main candidates in the election clashed over how to handle Catalan separatism in a TV debate on Monday. Polls suggest this could be a decisive issue in the Nov. 10 poll, with the Socialists, led by Sanchez, still ahead but slipping in support while right-wing parties, who have promised to take a harder line on the restive region, see a surge.
Independence is highly divisive in Catalonia, with a poll in July showing 44 per cent backing secession and 48.3 per cent against it.