This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ivysettings> | |
<settings defaultResolver="ibibliothengoogle"/> | |
<resolvers> | |
<chain name="ibibliothengoogle" returnFirst="true"> | |
<ibiblio name="ibiblio" m2compatible="true" /> | |
<packager name="google" buildRoot="${user.home}/.ivy2/packager/build" | |
resourceCache="${user.home}/.ivy2/packager/cache"> | |
<ivy pattern=" | |
http://ivyroundup.googlecode.com/svn/trunk/repo/modules/[organisation]/[module]/[revision]/ivy.xml | |
"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- ================================= | |
target: clean | |
================================= --> | |
<target name="clean" description="--> clean the project"> | |
<delete includeemptydirs="true" quiet="true"> | |
<fileset dir="${src.dir}" /> | |
<fileset dir="${build.dir}" /> | |
</delete> | |
</target> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NextQuarterAdjuster implements DateAdjuster { | |
private final Set<MonthOfYear> _futureQuarters = | |
Sets.newHashSet(MonthOfYear.MARCH, | |
MonthOfYear.JUNE, | |
MonthOfYear.SEPTEMBER, | |
MonthOfYear.DECEMBER); | |
@Override | |
public LocalDate adjustDate(LocalDate date) { | |
LocalDate result = date; | |
do { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NextExpiryAdjuster implements DateAdjuster { | |
private static final DateAdjuster s_thirdWedAdjuster = | |
DateAdjusters.dayOfWeekInMonth(3, DayOfWeek.WEDNESDAY); | |
private static final DateAdjuster s_nextQuarterAdjuster = | |
new NextQuarterAdjuster(); | |
private final Set<MonthOfYear> _futureQuarters = | |
Sets.newHashSet(MonthOfYear.MARCH, MonthOfYear.JUNE, | |
MonthOfYear.SEPTEMBER, MonthOfYear.DECEMBER); | |
@Override | |
public LocalDate adjustDate(final LocalDate date) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public double[] method(double[][] A, double[] x, int m, int n) { | |
double[] y = new double[m]; | |
for (int i = 0; i < m; i++) { | |
for (int j = 0; j < n; j++) { | |
y[i] += A[i][j] * x[j]; | |
} | |
} | |
return y; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# Copyright (C) 2011 - present by OpenGamma Inc. and the OpenGamma group of companies | |
# | |
# Please see distribution for license. | |
## | |
# Loads the time-series for yield curve data points to construct a 3D "curve over time" graph. | |
# Curve tickers | |
tickers <- c ("US00O/N Index", "US0001W Index", "US0002W Index", "US0001M Index", "US0002M Index", "US0003M Index", "USSW2 Curncy", "USSW3 Curncy", "USSW4 Curncy", "USSW5 Curncy", "USSW6 Curncy", "USSW7 Curncy", "USSW8 Curncy", "USSW9 Curncy", "USSW10 Curncy", "USSW15 Curncy", "USSW20 Curncy", "USSW25 Curncy", "USSW30 Curncy") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final int[] rowPtr = A.getRowPtr(); // get the row pointer | |
final int[] colIdx = A.getColumnIndex(); // get the column index | |
final double[] values = A.getNonZeroElements(); // get the nonzero elements | |
final int rows = A.getNumberOfRows(); // get the number of rows | |
double[] result = new double[rows]; // allocate memory for the result vector | |
int ptr = 0; // this indicates where we have got to in the data variable "values" | |
for (int i = 0; i < rows; i++) { // loop over rows | |
for (int j = rowPtr[i]; j < rowPtr[i + 1]; j++) { // accessing this many elements in row[i] | |
result[i] += values[ptr] * x[colIdx[ptr]]; // accumulate the result. |