Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of github.com:scikit-learn/scikit-learn

  • Loading branch information...
commit 192d243edf9f1e567bb0b429f5b7628e24f7f074 2 parents 0b8aa6c + 20937eb
@ogrisel ogrisel authored
Showing with 3,547 additions and 688 deletions.
  1. +48 −4 scikits/learn/base.py
  2. +5 −5 scikits/learn/cross_val.py
  3. +1 −1  scikits/learn/glm/__init__.py
  4. +0 −140 scikits/learn/glm/lars.py
  5. +3 −2 scikits/learn/glm/tests/test_bayes.py
  6. +1 −154 scikits/learn/glm/tests/test_lars.py
  7. +29 −13 scikits/learn/grid_search.py
  8. +1 −1  scikits/learn/pipeline.py
  9. +27 −11 scikits/learn/preprocessing.py
  10. +148 −0 scikits/learn/src/cblas/ATL_drefcopy.c
  11. +170 −0 scikits/learn/src/cblas/ATL_drefrot.c
  12. +146 −0 scikits/learn/src/cblas/ATL_drefrotg.c
  13. +0 −99 scikits/learn/src/cblas/ATL_dreftpsvLTN.c
  14. +0 −99 scikits/learn/src/cblas/ATL_dreftpsvLTU.c
  15. +32 −30 scikits/learn/src/cblas/{ATL_dtpsv.c → ATL_dreftrsv.c}
  16. +11 −15 scikits/learn/src/cblas/{ATL_dreftpsvLNU.c → ATL_dreftrsvLNN.c}
  17. +13 −17 scikits/learn/src/cblas/{ATL_dreftpsvLNN.c → ATL_dreftrsvLNU.c}
  18. +96 −0 scikits/learn/src/cblas/ATL_dreftrsvLTN.c
  19. +96 −0 scikits/learn/src/cblas/ATL_dreftrsvLTU.c
  20. +11 −15 scikits/learn/src/cblas/{ATL_dreftpsvUNN.c → ATL_dreftrsvUNN.c}
  21. +11 −15 scikits/learn/src/cblas/{ATL_dreftpsvUNU.c → ATL_dreftrsvUNU.c}
  22. +11 −14 scikits/learn/src/cblas/{ATL_dreftpsvUTU.c → ATL_dreftrsvUTN.c}
  23. +11 −14 scikits/learn/src/cblas/{ATL_dreftpsvUTN.c → ATL_dreftrsvUTU.c}
  24. +942 −0 scikits/learn/src/cblas/atlas_aux.h
  25. 0  scikits/learn/src/cblas/atlas_dsysinfo.h
  26. +129 −0 scikits/learn/src/cblas/atlas_level1.h
  27. +338 −0 scikits/learn/src/cblas/atlas_level2.h
  28. +477 −0 scikits/learn/src/cblas/atlas_misc.h
  29. +59 −0 scikits/learn/src/cblas/atlas_refalias1.h
  30. +85 −0 scikits/learn/src/cblas/atlas_refalias2.h
  31. +423 −0 scikits/learn/src/cblas/atlas_reflevel1.h
  32. +1 −0  scikits/learn/src/cblas/atlas_reflevel2.h
  33. 0  scikits/learn/src/cblas/atlas_type.h
  34. +52 −0 scikits/learn/src/cblas/cblas_dcopy.c
  35. +60 −0 scikits/learn/src/cblas/cblas_drot.c
  36. +42 −0 scikits/learn/src/cblas/cblas_drotg.c
  37. +13 −9 scikits/learn/src/cblas/{cblas_dtpsv.c → cblas_dtrsv.c}
  38. +17 −2 scikits/learn/tests/test_base.py
  39. +12 −17 scikits/learn/tests/test_gmm.py
  40. +12 −2 scikits/learn/tests/test_pipeline.py
  41. +14 −9 scikits/learn/tests/test_preprocessing.py
View
52 scikits/learn/base.py
@@ -6,24 +6,45 @@
# License: BSD Style
import inspect
+import copy
import numpy as np
from .metrics import explained_variance
################################################################################
-def clone(estimator):
+def clone(estimator, safe=True):
""" Constructs a new estimator with the same parameters.
Clone does a deep copy of the model in an estimator
without actually copying attached data. It yields a new estimator
with the same parameters that has not been fit on any data.
+
+ Parameters
+ ============
+ estimator: estimator object, or list, tuple or set of objects
+ The estimator or group of estimators to be cloned
+ safe: boolean, optional
+ If safe is false, clone will fall back to a deepcopy on objects
+ that are not estimators.
+
"""
+ estimator_type = type(estimator)
+ # XXX: not handling dictionnaries
+ if estimator_type in (list, tuple, set, frozenset):
+ return estimator_type([clone(e, safe=safe) for e in estimator])
+ elif not hasattr(estimator, '_get_params'):
+ if not safe:
+ return copy.deepcopy(estimator)
+ else:
+ raise ValueError("Cannot clone object '%s' (type %s): "
+ "it does not seem to be a scikit-learn estimator as "
+ "it does not implement a '_get_params' methods."
+ % (repr(estimator), type(estimator)))
klass = estimator.__class__
new_object_params = estimator._get_params(deep=False)
for name, param in new_object_params.iteritems():
- if hasattr(param, '_get_params'):
- new_object_params[name] = clone(param)
+ new_object_params[name] = clone(param, safe=False)
new_object = klass(**new_object_params)
return new_object
@@ -108,7 +129,7 @@ def _get_param_names(cls):
args = []
return args
- def _get_params(self, deep=False):
+ def _get_params(self, deep=True):
""" Get parameters for the estimator
Parameters
@@ -220,3 +241,26 @@ def score(self, X, y):
z : float
"""
return explained_variance(self.predict(X), y)
+
+
+################################################################################
+# XXX: Temporary solution to figure out if an estimator is a classifier
+
+def _get_sub_estimator(estimator):
+ """ Returns the final estimator if there is any.
+ """
+ if hasattr(estimator, 'estimator'):
+ # GridSearchCV and other CV-tuned estimators
+ return _get_sub_estimator(estimator.estimator)
+ if hasattr(estimator, 'steps'):
+ # Pipeline
+ return _get_sub_estimator(estimator.steps[-1][1])
+ return estimator
+
+
+def is_classifier(estimator):
+ """ Returns True if the given estimator is (probably) a classifier.
+ """
+ estimator = _get_sub_estimator(estimator)
+ return isinstance(estimator, ClassifierMixin)
+
View
10 scikits/learn/cross_val.py
@@ -9,7 +9,7 @@
from math import ceil
import numpy as np
-from .base import ClassifierMixin
+from .base import is_classifier, clone
from .utils.extmath import factorial, combinations
from .externals.joblib import Parallel, delayed
@@ -485,9 +485,7 @@ def cross_val_score(estimator, X, y=None, score_func=None, cv=None,
"""
n_samples = len(X)
if cv is None:
- if y is not None and (isinstance(estimator, ClassifierMixin)
- or (hasattr(estimator, 'estimator')
- and isinstance(estimator.estimator, ClassifierMixin))):
+ if y is not None and is_classifier(estimator):
cv = StratifiedKFold(y, k=3)
else:
cv = KFold(n_samples, k=3)
@@ -497,8 +495,10 @@ def cross_val_score(estimator, X, y=None, score_func=None, cv=None,
"should have a 'score' method. The estimator %s "
"does not." % estimator
)
+ # We clone the estimator to make sure that all the folds are
+ # independent, and that it is pickable.
scores = Parallel(n_jobs=n_jobs, verbose=verbose)(
- delayed(_cross_val_score)(estimator, X, y, score_func,
+ delayed(_cross_val_score)(clone(estimator), X, y, score_func,
train, test)
for train, test in cv)
return np.array(scores)
View
2  scikits/learn/glm/__init__.py
@@ -12,7 +12,7 @@
from .bayes import BayesianRidge, ARDRegression
from .base import LinearRegression
from .bayes import BayesianRidge, ARDRegression
-from .lars import LARS, LassoLARS, lars_path, LeastAngleRegression
+from .lars import LARS, LassoLARS, lars_path
from .coordinate_descent import Lasso, ElasticNet, LassoCV, ElasticNetCV, \
lasso_path, enet_path
from .ridge import Ridge
View
140 scikits/learn/glm/lars.py
@@ -13,13 +13,9 @@
import scipy.sparse as sp # needed by LeastAngleRegression
from .base import LinearModel
-from .._minilearn import lars_fit_wrap
from ..utils.fixes import copysign
from ..utils import arrayfuncs
-# all linalg.solve solve a triangular system, so this could be heavily
-# optimized by binding (in scipy ?) trsv or trsm
-
def lars_path(X, y, Gram=None, max_iter=None, alpha_min=0,
method="lar", precompute=True):
""" Compute Least Angle Regression and LASSO path
@@ -65,8 +61,6 @@ def lars_path(X, y, Gram=None, max_iter=None, alpha_min=0,
XXX : add reference papers
"""
- # TODO: precompute : empty for now
- #
# TODO: detect stationary points.
# Lasso variant
# store full path
@@ -395,137 +389,3 @@ def fit (self, X, y, Gram=None, **params):
return self
-
-#### OLD C-based LARS : will probably be removed
-
-
-class LeastAngleRegression(LinearModel):
- """
- Least Angle Regression using the LARS algorithm.
-
- Attributes
- ----------
- `coef_` : array, shape = [n_features]
- parameter vector (w in the fomulation formula)
-
- `intercept_` : float
- independent term in decision function.
-
- `coef_path_` : array, shape = [max_features + 1, n_features]
- Full coeffients path.
-
- Notes
- -----
- predict does only work correctly in the case of normalized
- predictors.
-
- See also
- --------
- scikits.learn.glm.Lasso
-
- """
-
- def __init__(self):
- self.alphas_ = np.empty(0, dtype=np.float64)
- self._chol = np.empty(0, dtype=np.float64)
- self.beta_ = np.empty(0, dtype=np.float64)
-
- def fit (self, X, Y, fit_intercept=True, max_features=None, normalize=True):
- """
- Fit the model according to data X, Y.
-
- Parameters
- ----------
- X : numpy array of shape [n_samples,n_features]
- Training data
-
- Y : numpy array of shape [n_samples]
- Target values
-
- fit_intercept : boolean, optional
- wether to calculate the intercept for this model. If set
- to false, no intercept will be used in calculations
- (e.g. data is expected to be already centered).
-
- max_features : int, optional
- number of features to get into the model. The iterative
- will stop just before the `max_features` variable enters
- in the active set. If not specified, min(N, p) - 1
- will be used.
-
- normalize : boolean
- whether to normalize (make all non-zero columns have mean
- 0 and norm 1).
- """
- ## TODO: resize (not create) arrays, check shape,
- ## add a real intercept
-
- X = np.asanyarray(X, dtype=np.float64, order='C')
- _Y = np.asanyarray(Y, dtype=np.float64, order='C')
-
- if Y is _Y: Y = _Y.copy()
- else: Y = _Y
-
- if max_features is None:
- max_features = min(*X.shape)-1
-
- sum_k = max_features * (max_features + 1) /2
- self.alphas_.resize(max_features + 1)
- self._chol.resize(sum_k)
- self.beta_.resize(sum_k)
- coef_row = np.zeros(sum_k, dtype=np.int32)
- coef_col = np.zeros(sum_k, dtype=np.int32)
-
-
- if normalize:
- # will only normalize non-zero columns
- self._xmean = X.mean(0)
- self._ymean = Y.mean(0)
- X = X - self._xmean
- Y = Y - self._ymean
- self._norms = np.apply_along_axis (np.linalg.norm, 0, X)
- nonzeros = np.flatnonzero(self._norms)
- X[:, nonzeros] /= self._norms[nonzeros]
- else:
- self._xmean = 0.
- self._ymean = 0.
-
- lars_fit_wrap(0, X, Y, self.beta_, self.alphas_, coef_row,
- coef_col, self._chol, max_features)
-
- self.coef_path_ = sp.coo_matrix((self.beta_,
- (coef_row, coef_col)),
- shape=(X.shape[1], max_features+1)).todense()
-
- self.coef_ = np.ravel(self.coef_path_[:, max_features])
-
- # XXX : should use self._set_intercept
- if fit_intercept:
- self.intercept_ = self._ymean
- else:
- self.intercept_ = 0.
-
- return self
-
-
- def predict(self, X, normalize=True):
- """
- Predict using the linear model.
-
- Parameters
- ----------
- X : numpy array of shape [n_samples,n_features]
-
- Returns
- -------
- C : array, shape = [n_samples]
- Returns predicted values.
- """
- X = np.asanyarray(X, dtype=np.float64, order='C')
- if normalize:
- X -= self._xmean
- X /= self._norms
- return np.dot(X, self.coef_) + self.intercept_
-
-
-
View
5 scikits/learn/glm/tests/test_bayes.py
@@ -6,13 +6,14 @@
import numpy as np
from numpy.testing import assert_array_equal, \
- assert_array_almost_equal
+ assert_array_almost_equal, decorators
from ..bayes import BayesianRidge, ARDRegression
from scikits.learn import datasets
-def XFailed_test_bayesian_on_diabetes():
+@decorators.skipif(True, "XFailed test")
+def test_bayesian_on_diabetes():
"""
Test BayesianRidge on diabetes
"""
View
155 scikits/learn/glm/tests/test_lars.py
@@ -4,7 +4,7 @@
from nose.tools import assert_equal, assert_true
-from ..lars import lars_path, LeastAngleRegression, LassoLARS, LARS
+from ..lars import lars_path, LassoLARS, LARS
from ..coordinate_descent import Lasso
from scikits.learn import datasets
@@ -96,156 +96,3 @@ def test_lasso_lars_vs_lasso_cd(verbose=False):
assert error < 1e-5
-
-################################################################################
-# Test LeastAngleRegression
-################################################################################
-
-def test_toy():
- """Very simple test on a small dataset"""
- X = [[1, 0, -1.],
- [0, 0, 0],
- [0, 1, .9]]
- Y = [1, 0, -1]
-
- clf = LeastAngleRegression().fit(X, Y, max_features=1)
- assert_array_almost_equal(clf.coef_, [0, 0, -1.2624], decimal=4)
- assert_array_almost_equal(clf.alphas_, [1.4135, 0.1510], decimal=4)
- assert_array_almost_equal(clf.alphas_.shape, clf.coef_path_.shape[1])
- assert np.linalg.norm(clf.predict(X) - Y) < 0.3
-
-
- clf = LeastAngleRegression().fit(X, Y) # implicitly max_features=2
- assert_array_almost_equal(clf.coef_, [0, -.0816, -1.34412], decimal=4)
- assert_array_almost_equal(clf.alphas_, \
- [ 1.41356, .1510, 3.919e-16], decimal=4)
- assert_array_almost_equal(clf.alphas_.shape, clf.coef_path_.shape[1])
- assert_array_almost_equal(clf.predict(X), np.array(Y))
-
- # TODO: check that Lasso with coordinate descent finds the same
- # coefficients
-
-
-def test_toy2():
- """
- Check that LAR responds well to features (columns) that are zero
- arrays.
- """
- X = [[0, 0],
- [0, 1]]
- Y = [0, 1]
- clf = LeastAngleRegression().fit(X, Y)
- assert_array_almost_equal(clf.coef_, [0., .70], decimal=2)
-
-
-def test_feature_selection():
- n_samples, n_features = 442, 100
-
- # deterministic test
- np.random.seed(0)
-
- # generate random input set
- X = np.random.randn(n_samples, n_features)
-
- # generate a ground truth model with only the first 10 features being non
- # zeros (the other features are not correlated to Y and should be ignored by
- # the L1 regularizer)
- coef_ = np.random.randn(n_features)
- coef_[10:] = 0.0
-
- # generate the grand truth Y from the model and Y
- Y = np.dot(X, coef_)
- Y += np.random.normal(Y.shape) # make some (label) noise!
-
- # fit the model assuming that will allready know that only 10 out of
- # n_features are contributing to Y
- clf = LeastAngleRegression().fit(X, Y, max_features=10)
-
- # ensure that only the first 10 coefs are non zeros and the remaining set to
- # null, as in the ground thrutg model
- assert_equal((clf.coef_[:10] == 0.0).sum(), 0)
- assert_equal((clf.coef_[10:] != 0.0).sum(), 0)
-
- # train again, but this time without knowing in advance how many features
- # are useful:
- clf = LeastAngleRegression().fit(X, Y, max_features=None)
- assert_equal((clf.coef_[:10] == 0.0).sum(), 0)
- assert_equal((clf.coef_[10:] != 0.0).sum(), 89)
-
- # explicitly set to zero parameters really close to zero (manual
- # thresholding)
- sparse_coef = np.where(abs(clf.coef_) < 1e-13,
- np.zeros(clf.coef_.shape),
- clf.coef_)
-
- # we find again that only the first 10 features are useful
- assert_equal((sparse_coef[:10] == 0.0).sum(), 0)
- assert_equal((sparse_coef[10:] != 0.0).sum(), 0)
-
-
-def test_predict(verbose=False):
- """
- Just see if predicted values are close from known response.
- """
- n, m = 10, 20
- np.random.seed(0)
- X = np.random.randn(n, m)
- Y = np.random.randn(n)
- Y = Y - Y.mean() # center response
-
- Y_ = LeastAngleRegression().fit(X, Y, fit_intercept=False).predict(X)
- if verbose:
- print np.linalg.norm(Y - Y_)
- assert np.linalg.norm(Y-Y_) < 1e-10
-
-
- # the same but with an intercept
- Y = Y + 10.
- Y_ = LeastAngleRegression().fit(X, Y).predict(X)
- assert np.linalg.norm(Y-Y_) < 1e-10
-
-
-def test_sparse_coding():
- """Use LARS as a sparse encoder w.r.t to a given fixed dictionary"""
- n_samples, n_features = 42, 100
- n_dictionary = 30
- max_features = 5
-
- # generate random input set
- X = np.random.randn(n_samples, n_features)
-
- # take the first vectors of the dataset as a dictionnary
- D = X[:n_dictionary].T
-
- assert_equal(D.shape, (n_features, n_dictionary))
-
- def sparse_encode(vector):
- return LeastAngleRegression().fit(
- D, vector, max_features=max_features, normalize=False,
- fit_intercept=False
- ).coef_
-
- def sparse_decode(vector):
- return np.dot(D, vector)
-
- # sparse encode each vector and check the quality of the encoded
- # representation
- for i, x_i in enumerate(X):
- # compute a sparse representation of x_i using the dictionary D
- c_i = sparse_encode(x_i)
-
- assert_equal(c_i.shape, (n_dictionary,))
-
- if i < n_dictionary:
- # x_i is one of the vector of D hence there is a trivial sparse code
- expected_code = np.zeros(n_dictionary)
- expected_code[i] = 1.0
-
- assert_almost_equal(c_i, expected_code, decimal=2)
- else:
- # x_i does not exactly belong to the dictionary, hence up to 5
- # components of the dictionary are used to represent it
- assert_true((c_i != 0.0).sum() <= max_features)
-
-
-
View
42 scikits/learn/grid_search.py
@@ -10,7 +10,7 @@
from .externals.joblib import Parallel, delayed
from .cross_val import KFold, StratifiedKFold
-from .base import ClassifierMixin, clone
+from .base import BaseEstimator, is_classifier, clone
try:
from itertools import product
@@ -50,9 +50,11 @@ def iter_grid(param_grid):
if hasattr(param_grid, 'has_key'):
param_grid = [param_grid]
for p in param_grid:
- keys = p.keys()
- for v in product(*p.values()):
- params = dict(zip(keys,v))
+ # Always sort the keys of a dictionary, for reproducibility
+ items = sorted(p.items())
+ keys, values = zip(*items)
+ for v in product(*values):
+ params = dict(zip(keys, v))
yield params
@@ -65,7 +67,8 @@ def fit_grid_point(X, y, base_clf, clf_params, cv, loss_func, iid,
clf = copy.deepcopy(base_clf)
clf._set_params(**clf_params)
- score = 0
+ score = 0.
+ n_test_samples = 0.
for train, test in cv:
clf.fit(X[train], y[train], **fit_params)
y_test = y[test]
@@ -76,13 +79,16 @@ def fit_grid_point(X, y, base_clf, clf_params, cv, loss_func, iid,
this_score = clf.score(X[test], y_test)
if iid:
this_score *= len(y_test)
+ n_test_samples += len(y_test)
score += this_score
+ if iid:
+ score /= n_test_samples
- return clf, score
+ return score, clf
################################################################################
-class GridSearchCV(object):
+class GridSearchCV(BaseEstimator):
"""
Grid search on the parameters of a classifier.
@@ -181,9 +187,7 @@ def fit(self, X, y, cv=None, **kw):
estimator = self.estimator
if cv is None:
n_samples = len(X)
- if y is not None and (isinstance(estimator, ClassifierMixin)
- or (hasattr(estimator, 'estimator')
- and isinstance(estimator.estimator, ClassifierMixin))):
+ if y is not None and is_classifier(estimator):
cv = StratifiedKFold(y, k=3)
else:
cv = KFold(n_samples, k=3)
@@ -195,16 +199,28 @@ def fit(self, X, y, cv=None, **kw):
cv, self.loss_func, self.iid, **self.fit_params)
for clf_params in grid)
- # Out is a list of pairs: estimator, score
- key = lambda pair: pair[1]
- best_estimator = max(out, key=key)[0] # get maximum score
+ # Out is a list of pairs: score, estimator
+ best_estimator = max(out)[1] # get maximum score
self.best_estimator = best_estimator
self.predict = best_estimator.predict
+ if hasattr(best_estimator, 'score'):
+ self.score = best_estimator.score
+
+ # Store the computed scores
+ grid = iter_grid(self.param_grid)
+ self.grid_points_scores_ = dict((tuple(clf_params.items()), score)
+ for clf_params, (score, _) in zip(grid, out))
return self
+ def score(self, X, y=None):
+ # This method is overridden during the fit if the best estimator
+ # found has a score function.
+ y_predicted = self.predict(X)
+ return -self.loss_func(y_predicted, y)
+
if __name__ == '__main__':
from scikits.learn.svm import SVC
from scikits.learn import datasets
View
2  scikits/learn/pipeline.py
@@ -105,7 +105,7 @@ def __init__(self, steps):
"'%s' (type %s) doesn't)" % (estimator, type(estimator))
)
- def _get_params(self, deep=False):
+ def _get_params(self, deep=True):
if not deep:
return super(Pipeline, self)._get_params(deep=False)
else:
View
38 scikits/learn/preprocessing.py
@@ -8,31 +8,47 @@
from .base import BaseEstimator
+
+def _mean_and_std(X, axis=0, with_std=True):
+ Xr = np.rollaxis(X, axis)
+ mean_ = Xr.mean(axis=0)
+ std_ = Xr.std(axis=0) if with_std else None
+ return mean_, std_
+
+
+def scale(X, axis=0, with_std=True, copy=True):
+ """Method to standardize a dataset along any axis
+ """
+ mean_, std_ = _mean_and_std(X, axis, with_std)
+ if copy:
+ X = X.copy()
+ Xr = np.rollaxis(X, axis)
+ Xr -= mean_
+ if with_std:
+ Xr /= std_
+ return X
+
+
class Scaler(BaseEstimator):
- """Object to standardize a dataset along any axis
+ """Object to standardize a dataset
It centers the dataset and optionaly scales to
- fix the variance to 1.
+ fix the variance to 1 for each feature
"""
- def __init__(self, axis=0, with_std=True):
- self.axis = axis
+ def __init__(self, with_std=True):
self.with_std = with_std
def fit(self, X, y=None, **params):
self._set_params(**params)
- X = np.rollaxis(X, self.axis)
- self.mean = X.mean(axis=0)
- if self.with_std:
- self.std = X.std(axis=0)
+ self.mean_, self.std_ = _mean_and_std(X, axis=0, with_std=self.with_std)
return self
def transform(self, X, y=None, copy=True):
if copy:
X = X.copy()
# We are taking a view of the X array and modifying it
- Xr = np.rollaxis(X, self.axis)
- Xr -= self.mean
+ X -= self.mean_
if self.with_std:
- Xr /= self.std
+ X /= self.std_
return X
View
148 scikits/learn/src/cblas/ATL_drefcopy.c
@@ -0,0 +1,148 @@
+/* ---------------------------------------------------------------------
+ *
+ * -- Automatically Tuned Linear Algebra Software (ATLAS)
+ * (C) Copyright 2000 All Rights Reserved
+ *
+ * -- ATLAS routine -- Version 3.9.24 -- December 25, 2000
+ *
+ * Author : Antoine P. Petitet
+ * Originally developed at the University of Tennessee,
+ * Innovative Computing Laboratory, Knoxville TN, 37996-1301, USA.
+ *
+ * ---------------------------------------------------------------------
+ *
+ * -- Copyright notice and Licensing terms:
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions, and the following disclaimer in
+ * the documentation and/or other materials provided with the distri-
+ * bution.
+ * 3. The name of the University, the ATLAS group, or the names of its
+ * contributors may not be used to endorse or promote products deri-
+ * ved from this software without specific written permission.
+ *
+ * -- Disclaimer:
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE-
+ * CIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+ * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEO-
+ * RY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (IN-
+ * CLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * ---------------------------------------------------------------------
+ */
+/*
+ * Include files
+ */
+#include "atlas_refmisc.h"
+#include "atlas_reflevel1.h"
+
+void ATL_drefcopy
+(
+ const int N,
+ const double * X,
+ const int INCX,
+ double * Y,
+ const int INCY
+)
+{
+/*
+ * Purpose
+ * =======
+ *
+ * ATL_drefcopy copies the entries of an n-vector x into an n-vector y.
+ *
+ * Arguments
+ * =========
+ *
+ * N (input) const int
+ * On entry, N specifies the length of the vector x. N must be
+ * at least zero. Unchanged on exit.
+ *
+ * X (input) const double *
+ * On entry, X points to the first entry to be accessed of an
+ * incremented array of size equal to or greater than
+ * ( 1 + ( n - 1 ) * abs( INCX ) ) * sizeof( double ),
+ * that contains the vector x. Unchanged on exit.
+ *
+ * INCX (input) const int
+ * On entry, INCX specifies the increment for the elements of X.
+ * INCX must not be zero. Unchanged on exit.
+ *
+ * Y (input/output) double *
+ * On entry, Y points to the first entry to be accessed of an
+ * incremented array of size equal to or greater than
+ * ( 1 + ( n - 1 ) * abs( INCY ) ) * sizeof( double ),
+ * that contains the vector y. On exit, the entries of the in-
+ * cremented array X are copied into the entries of the incre-
+ * mented array Y.
+ *
+ * INCY (input) const int
+ * On entry, INCY specifies the increment for the elements of Y.
+ * INCY must not be zero. Unchanged on exit.
+ *
+ * ---------------------------------------------------------------------
+ */
+/*
+ * .. Local Variables ..
+ */
+ register double x0, x1, x2, x3, x4, x5, x6, x7;
+ double * StX;
+ register int i;
+ int nu;
+ const int incX2 = 2 * INCX, incY2 = 2 * INCY,
+ incX3 = 3 * INCX, incY3 = 3 * INCY,
+ incX4 = 4 * INCX, incY4 = 4 * INCY,
+ incX5 = 5 * INCX, incY5 = 5 * INCY,
+ incX6 = 6 * INCX, incY6 = 6 * INCY,
+ incX7 = 7 * INCX, incY7 = 7 * INCY,
+ incX8 = 8 * INCX, incY8 = 8 * INCY;
+/* ..
+ * .. Executable Statements ..
+ *
+ */
+ if( N > 0 )
+ {
+ if( ( nu = ( N >> 3 ) << 3 ) != 0 )
+ {
+ StX = (double *)X + nu * INCX;
+
+ do
+ {
+ x0 = (*X); x4 = X[incX4]; x1 = X[INCX ]; x5 = X[incX5];
+ x2 = X[incX2]; x6 = X[incX6]; x3 = X[incX3]; x7 = X[incX7];
+
+ *Y = x0; Y[incY4] = x4; Y[INCY ] = x1; Y[incY5] = x5;
+ Y[incY2] = x2; Y[incY6] = x6; Y[incY3] = x3; Y[incY7] = x7;
+
+ X += incX8;
+ Y += incY8;
+
+ } while( X != StX );
+ }
+
+ for( i = N - nu; i != 0; i-- )
+ {
+ x0 = (*X);
+ *Y = x0;
+
+ X += INCX;
+ Y += INCY;
+ }
+ }
+/*
+ * End of ATL_drefcopy
+ */
+}
View
170 scikits/learn/src/cblas/ATL_drefrot.c
@@ -0,0 +1,170 @@
+/* ---------------------------------------------------------------------
+ *
+ * -- Automatically Tuned Linear Algebra Software (ATLAS)
+ * (C) Copyright 2000 All Rights Reserved
+ *
+ * -- ATLAS routine -- Version 3.9.24 -- December 25, 2000
+ *
+ * Author : Antoine P. Petitet
+ * Originally developed at the University of Tennessee,
+ * Innovative Computing Laboratory, Knoxville TN, 37996-1301, USA.
+ *
+ * ---------------------------------------------------------------------
+ *
+ * -- Copyright notice and Licensing terms:
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions, and the following disclaimer in
+ * the documentation and/or other materials provided with the distri-
+ * bution.
+ * 3. The name of the University, the ATLAS group, or the names of its
+ * contributors may not be used to endorse or promote products deri-
+ * ved from this software without specific written permission.
+ *
+ * -- Disclaimer:
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE-
+ * CIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+ * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEO-
+ * RY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (IN-
+ * CLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * ---------------------------------------------------------------------
+ */
+/*
+ * Include files
+ */
+#include "atlas_refmisc.h"
+#include "atlas_reflevel1.h"
+
+void ATL_drefrot
+(
+ const int N,
+ double * X,
+ const int INCX,
+ double * Y,
+ const int INCY,
+ const double C,
+ const double S
+)
+{
+/*
+ * Purpose
+ * =======
+ *
+ * ATL_drefrot applies a plane rotation to the two n-vectors x and y.
+ * This routine computes:
+ *
+ * [ x_i ] [ c s ] [ x_i ]
+ * [ y_i ] = [ -s c ] [ y_i ] for all i = 1 .. n.
+ *
+ * If n <= 0 or if c = 1 and s = 0, this subroutine returns immediately.
+ *
+ * Arguments
+ * =========
+ *
+ * N (input) const int
+ * On entry, N specifies the length of the vector x. N must be
+ * at least zero. Unchanged on exit.
+ *
+ * X (input/output) double *
+ * On entry, X points to the first entry to be accessed of an
+ * incremented array of size equal to or greater than
+ * ( 1 + ( n - 1 ) * abs( INCX ) ) * sizeof( double ),
+ * that contains the vector x. On exit, the entries of the in-
+ * cremented array X are rotated with the entries of the incre-
+ * mented array Y.
+ *
+ * INCX (input) const int
+ * On entry, INCX specifies the increment for the elements of X.
+ * INCX must not be zero. Unchanged on exit.
+ *
+ * Y (input/output) double *
+ * On entry, Y points to the first entry to be accessed of an
+ * incremented array of size equal to or greater than
+ * ( 1 + ( n - 1 ) * abs( INCY ) ) * sizeof( double ),
+ * that contains the vector y. On exit, the entries of the in-
+ * cremented array Y are rotated with the entries of the incre-
+ * mented array X.
+ *
+ * INCY (input) const int
+ * On entry, INCY specifies the increment for the elements of Y.
+ * INCY must not be zero. Unchanged on exit.
+ *
+ * C (input) const double
+ * On entry, C specifies the scalar c definiting the plane rota-
+ * tion. Unchanged on exit.
+ *
+ * S (input) const double
+ * On entry, S specifies the scalar s definiting the plane rota-
+ * tion. Unchanged on exit.
+ *
+ * ---------------------------------------------------------------------
+ */
+/*
+ * .. Local Variables ..
+ */
+ register double x0, x1, x2, x3, y0, y1, y2, y3;
+ register const double co = C, si = S;
+ double * StX;
+ register int i;
+ int nu;
+ const int incX2 = 2 * INCX, incY2 = 2 * INCY,
+ incX3 = 3 * INCX, incY3 = 3 * INCY,
+ incX4 = 4 * INCX, incY4 = 4 * INCY;
+/* ..
+ * .. Executable Statements ..
+ *
+ */
+ if( ( N > 0 ) && !Mdone( co, si ) )
+ {
+ if( ( nu = ( N >> 2 ) << 2 ) != 0 )
+ {
+ StX = (double *)X + nu * INCX;
+
+ do
+ {
+ x0 = (*X); y0 = (*Y);
+ x1 = X[INCX ]; y1 = Y[INCY ];
+ x2 = X[incX2]; y2 = Y[incY2];
+ x3 = X[incX3]; y3 = Y[incY3];
+
+ *X = co * x0 + si * y0; *Y = co * y0 - si * x0;
+ X[INCX ] = co * x1 + si * y1; Y[INCY ] = co * y1 - si * x1;
+ X[incX2] = co * x2 + si * y2; Y[incY2] = co * y2 - si * x2;
+ X[incX3] = co * x3 + si * y3; Y[incY3] = co * y3 - si * x3;
+
+ X += incX4;
+ Y += incY4;
+
+ } while( X != StX );
+ }
+
+ for( i = N - nu; i != 0; i-- )
+ {
+ x0 = (*X);
+ y0 = (*Y);
+
+ *X = co * x0 + si * y0;
+ *Y = co * y0 - si * x0;
+
+ X += INCX;
+ Y += INCY;
+ }
+ }
+/*
+ * End of ATL_drefrot
+ */
+}
View
146 scikits/learn/src/cblas/ATL_drefrotg.c
@@ -0,0 +1,146 @@
+/* ---------------------------------------------------------------------
+ *
+ * -- Automatically Tuned Linear Algebra Software (ATLAS)
+ * (C) Copyright 2000 All Rights Reserved
+ *
+ * -- ATLAS routine -- Version 3.9.24 -- December 25, 2000
+ *
+ * Author : Antoine P. Petitet
+ * Originally developed at the University of Tennessee,
+ * Innovative Computing Laboratory, Knoxville TN, 37996-1301, USA.
+ *
+ * ---------------------------------------------------------------------
+ *
+ * -- Copyright notice and Licensing terms:
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions, and the following disclaimer in
+ * the documentation and/or other materials provided with the distri-
+ * bution.
+ * 3. The name of the University, the ATLAS group, or the names of its
+ * contributors may not be used to endorse or promote products deri-
+ * ved from this software without specific written permission.
+ *
+ * -- Disclaimer:
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE-
+ * CIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+ * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEO-
+ * RY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (IN-
+ * CLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * ---------------------------------------------------------------------
+ */
+/*
+ * Include files
+ */
+#include "atlas_refmisc.h"
+#include "atlas_reflevel1.h"
+
+void ATL_drefrotg
+(
+ double * A,
+ double * B,
+ double * C,
+ double * S
+)
+{
+/*
+ * Purpose
+ * =======
+ *
+ * ATL_drefrotg constructs a Givens plane rotation. Given the scalars a
+ * and b, this routine computes the following quantities:
+ *
+ * sigma = sgn(a) if |a| > |b|, sgn(b) otherwise;
+ * r = sigma * sqrt( a^2 + b^2 );
+ * c = a / r if r <> 0, 1 otherwise;
+ * s = b / r if r <> 0, 0 otherwise.
+ *
+ * The numbers c, s and r then satisfy the matrix equation:
+ *
+ * [ c s ] [ a ] [ r ]
+ * [ -s c ] [ b ] = [ 0 ].
+ *
+ * The introduction of sigma is not essential to the computation of a
+ * Givens rotation matrix, but it permits later stable reconstruction of
+ * c and s from just one stored number. For this purpose, this routine
+ * also computes
+ *
+ * s if |a| > |b|,
+ * z = 1 / c if |b| >= |a| and c <> 0,
+ * 1 if c = 0.
+ *
+ * This subroutine returns r overwriting a, and z overwriting b, as well
+ * as returning c and s. If one later wishes to reconstruct c and s from
+ * z, it can be done as follows:
+ *
+ * if z = 1, set c = 0 and s = 1,
+ * if |z| < 1, set c = sqrt(1 - z^2) and s = z,
+ * if |z| > 1, set c = 1 / z and s = sqrt(1 - c^2).
+ *
+ * See ``Basic Linear Algebra Subprograms for Fortran Usage'' by C. Law-
+ * son, R. Hanson, D. Kincaid and F. Krogh, ACM Transactions on Mathema-
+ * tical Software, 1979, 5(3) pp 308-323, for further information.
+ *
+ * Arguments
+ * =========
+ *
+ * A (input/output) double *
+ * On entry, A specifies the scalar a. On exit, A is overwritten
+ * by the scalar r defined above.
+ *
+ * B (input/output) double *
+ * On entry, B specifies the scalar b. On exit, B is overwritten
+ * by the scalar z defined above.
+ *
+ * C (output) double *
+ * On exit, C specifies the scalar c defined above.
+ *
+ * S (output) double *
+ * On exit, S specifies the scalar s defined above.
+ *
+ * ---------------------------------------------------------------------
+ */
+/*
+ * .. Local Variables ..
+ */
+ register double absa, absb, roe, scale, r, tmpa, tmpb, z;
+/* ..
+ * .. Executable Statements ..
+ *
+ */
+ absa = Mdabs( *A ); absb = Mdabs( *B );
+ roe = ( absa > absb ? (*A) : (*B) ); scale = absa + absb;
+
+ if( scale != ATL_dZERO )
+ {
+ tmpa = (*A) / scale; tmpb = (*B) / scale;
+ if( roe < ATL_dZERO )
+ { r = - scale * sqrt( ( tmpa * tmpa ) + ( tmpb * tmpb ) ); }
+ else
+ { r = scale * sqrt( ( tmpa * tmpa ) + ( tmpb * tmpb ) ); }
+ *C = (*A) / r; *S = (*B) / r; z = ATL_dONE;
+ if( absa > absb ) { z = *S; }
+ if( ( absb >= absa ) && ( (*C) != ATL_dZERO ) )
+ { z = ATL_dONE / (*C); }
+ }
+ else { *C = ATL_dONE; *S = r = z = ATL_dZERO; }
+
+ *A = r; *B = z;
+/*
+ * End of ATL_drefrotg
+ */
+}
View
99 scikits/learn/src/cblas/ATL_dreftpsvLTN.c
@@ -1,99 +0,0 @@
-/* ---------------------------------------------------------------------
- *
- * -- Automatically Tuned Linear Algebra Software (ATLAS)
- * (C) Copyright 2000 All Rights Reserved
- *
- * -- ATLAS routine -- Version 3.2 -- December 25, 2000
- *
- * -- Suggestions, comments, bugs reports should be sent to the follo-
- * wing e-mail address: atlas@cs.utk.edu
- *
- * Author : Antoine P. Petitet
- * University of Tennessee - Innovative Computing Laboratory
- * Knoxville TN, 37996-1301, USA.
- *
- * ---------------------------------------------------------------------
- *
- * -- Copyright notice and Licensing terms:
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions, and the following disclaimer in
- * the documentation and/or other materials provided with the distri-
- * bution.
- * 3. The name of the University, the ATLAS group, or the names of its
- * contributors may not be used to endorse or promote products deri-
- * ved from this software without specific written permission.
- *
- * -- Disclaimer:
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY
- * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE-
- * CIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEO-
- * RY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (IN-
- * CLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * ---------------------------------------------------------------------
- */
-/*
- * Include files
- */
-#include "atlas_refmisc.h"
-#include "atlas_reflvl2.h"
-#include "atlas_reflevel2.h"
-
-void ATL_dreftpsvLTN
-(
- const int N,
- const double * A,
- const int LDA,
- double * X,
- const int INCX
-)
-{
-/*
- * Purpose
- * =======
- *
- * ATL_dreftpsvLTN( ... )
- *
- * <=>
- *
- * ATL_dreftpsv( AtlasLower, AtlasTrans, AtlasNonUnit, ... )
- *
- * See ATL_dreftpsv for details.
- *
- * ---------------------------------------------------------------------
- */
-/*
- * .. Local Variables ..
- */
- register double t0;
- int i, iaij, ix, j, jaj, jx, lda = LDA - N + 1;
-/* ..
- * .. Executable Statements ..
- *
- */
- for( j = N-1, jaj = (LDA+1)*(N-1) - ( ((N-1)*N) >> 1 ), jx = (N-1)*INCX;
- j >= 0; j--, jx -= INCX )
- {
- t0 = X[jx];
- for( i = j+1, iaij = jaj+1, ix = jx + INCX;
- i < N; i++, iaij += 1, ix += INCX ) { t0 -= A[iaij] * X[ix]; }
- t0 /= A[jaj]; X[jx] = t0; lda += 1; jaj -= lda;
- }
-/*
- * End of ATL_dreftpsvLTN
- */
-}
View
99 scikits/learn/src/cblas/ATL_dreftpsvLTU.c
@@ -1,99 +0,0 @@
-/* ---------------------------------------------------------------------
- *
- * -- Automatically Tuned Linear Algebra Software (ATLAS)
- * (C) Copyright 2000 All Rights Reserved
- *
- * -- ATLAS routine -- Version 3.2 -- December 25, 2000
- *
- * -- Suggestions, comments, bugs reports should be sent to the follo-
- * wing e-mail address: atlas@cs.utk.edu
- *
- * Author : Antoine P. Petitet
- * University of Tennessee - Innovative Computing Laboratory
- * Knoxville TN, 37996-1301, USA.
- *
- * ---------------------------------------------------------------------
- *
- * -- Copyright notice and Licensing terms:
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions, and the following disclaimer in
- * the documentation and/or other materials provided with the distri-
- * bution.
- * 3. The name of the University, the ATLAS group, or the names of its
- * contributors may not be used to endorse or promote products deri-
- * ved from this software without specific written permission.
- *
- * -- Disclaimer:
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY
- * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE-
- * CIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEO-
- * RY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (IN-
- * CLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * ---------------------------------------------------------------------
- */
-/*
- * Include files
- */
-#include "atlas_refmisc.h"
-#include "atlas_reflvl2.h"
-#include "atlas_reflevel2.h"
-
-void ATL_dreftpsvLTU
-(
- const int N,
- const double * A,
- const int LDA,
- double * X,
- const int INCX
-)
-{
-/*
- * Purpose
- * =======
- *
- * ATL_dreftpsvLTU( ... )
- *
- * <=>
- *
- * ATL_dreftpsv( AtlasLower, AtlasTrans, AtlasUnit, ... )
- *
- * See ATL_dreftpsv for details.
- *
- * ---------------------------------------------------------------------
- */
-/*
- * .. Local Variables ..
- */
- register double t0;
- int i, iaij, ix, j, jaj, jx, lda = LDA - N + 1;
-/* ..
- * .. Executable Statements ..
- *
- */
- for( j = N-1, jaj = (LDA+1)*(N-1) - ( ((N-1)*N) >> 1 ), jx = (N-1)*INCX;
- j >= 0; j--, jx -= INCX )
- {
- t0 = X[jx];
- for( i = j+1, iaij = jaj+1, ix = jx + INCX;
- i < N; i++, iaij += 1, ix += INCX ) { t0 -= A[iaij] * X[ix]; }
- X[jx] = t0; lda += 1; jaj -= lda;
- }
-/*
- * End of ATL_dreftpsvLTU
- */
-}
View
62 scikits/learn/src/cblas/ATL_dtpsv.c → scikits/learn/src/cblas/ATL_dreftrsv.c
@@ -3,14 +3,11 @@
* -- Automatically Tuned Linear Algebra Software (ATLAS)
* (C) Copyright 2000 All Rights Reserved
*
- * -- ATLAS routine -- Version 3.2 -- December 25, 2000
- *
- * -- Suggestions, comments, bugs reports should be sent to the follo-
- * wing e-mail address: atlas@cs.utk.edu
+ * -- ATLAS routine -- Version 3.9.24 -- December 25, 2000
*
* Author : Antoine P. Petitet
- * University of Tennessee - Innovative Computing Laboratory
- * Knoxville TN, 37996-1301, USA.
+ * Originally developed at the University of Tennessee,
+ * Innovative Computing Laboratory, Knoxville TN, 37996-1301, USA.
*
* ---------------------------------------------------------------------
*
@@ -49,16 +46,18 @@
/*
* Include files
*/
-
#include "atlas_refmisc.h"
+#include "atlas_reflvl2.h"
+#include "atlas_reflevel2.h"
-void ATL_dtpsv
+void ATL_dreftrsv
(
const enum ATLAS_UPLO UPLO,
const enum ATLAS_TRANS TRANS,
const enum ATLAS_DIAG DIAG,
const int N,
const double * A,
+ const int LDA,
double * X,
const int INCX
)
@@ -67,12 +66,12 @@ void ATL_dtpsv
* Purpose
* =======
*
- * ATL_dreftpsv solves one of the systems of equations
+ * ATL_dreftrsv solves one of the systems of equations
*
* A * x = b, or A' * x = b,
*
* where b and x are n-element vectors and A is an n by n unit, or non-
- * unit, upper or lower triangular matrix, supplied in packed form.
+ * unit, upper or lower triangular matrix.
*
* No test for singularity or near-singularity is included in this
* routine. Such tests must be performed before calling this routine.
@@ -121,19 +120,22 @@ void ATL_dtpsv
*
* A (input) const double *
* On entry, A points to an array of size equal to or greater
- * than (( n*(n+1) ) / 2) * sizeof( double ). Before entry
- * with UPLO = AtlasUpper, the array A must contain the upper
- * triangular matrix packed sequentially, column by column, so
- * that A[ 0 ] contains a(0,0), A[ 1 ] and A[ 2 ] contain a(0,1)
- * and a(1,1) respectively, and so on. Before entry with
- * UPLO = AtlasLower, the array A must contain the lower tri-
- * angular matrix packed sequentially, column by column, so that
- * A[ 0 ] contains a(0,0), A[ 1 ] and A[ 2 ] contain a(1,0) and
- * a( 2, 0 ) respectively, and so on.
+ * than LDA * n * sizeof( double ). Before entry with
+ * UPLO = AtlasUpper, the leading n by n upper triangular part
+ * of the array A must contain the upper triangular matrix and
+ * the strictly lower triangular part of A is not referenced.
+ * Before entry with UPLO = AtlasLower, the leading n by n lower
+ * triangular part of the array A must contain the lower trian-
+ * gular matrix and the strictly upper triangular part of A is
+ * not referenced. Unchanged on exit.
*
* Note that when DIAG = AtlasUnit, the diagonal elements of A
- * are not referenced, but are assumed to be unity. Unchanged
- * on exit.
+ * are not referenced either, but are assumed to be unity.
+ *
+ * LDA (input) const int
+ * On entry, LDA specifies the leading dimension of A as decla-
+ * red in the calling (sub) program. LDA must be at least
+ * MAX( 1, n ). Unchanged on exit.
*
* X (input/output) double *
* On entry, X points to the first entry to be accessed of an
@@ -161,22 +163,22 @@ void ATL_dtpsv
{
if( DIAG == AtlasNonUnit )
{
- ATL_dreftpsvUNN( N, A, 1, X, INCX );
+ ATL_dreftrsvUNN( N, A, LDA, X, INCX );
}
else
{
- ATL_dreftpsvUNU( N, A, 1, X, INCX );
+ ATL_dreftrsvUNU( N, A, LDA, X, INCX );
}
}
else
{
if( DIAG == AtlasNonUnit )
{
- ATL_dreftpsvUTN( N, A, 1, X, INCX );
+ ATL_dreftrsvUTN( N, A, LDA, X, INCX );
}
else
{
- ATL_dreftpsvUTU( N, A, 1, X, INCX );
+ ATL_dreftrsvUTU( N, A, LDA, X, INCX );
}
}
}
@@ -186,26 +188,26 @@ void ATL_dtpsv
{
if( DIAG == AtlasNonUnit )
{
- ATL_dreftpsvLNN( N, A, N, X, INCX );
+ ATL_dreftrsvLNN( N, A, LDA, X, INCX );
}
else
{
- ATL_dreftpsvLNU( N, A, N, X, INCX );
+ ATL_dreftrsvLNU( N, A, LDA, X, INCX );
}
}
else
{
if( DIAG == AtlasNonUnit )
{
- ATL_dreftpsvLTN( N, A, N, X, INCX );
+ ATL_dreftrsvLTN( N, A, LDA, X, INCX );
}
else
{
- ATL_dreftpsvLTU( N, A, N, X, INCX );
+ ATL_dreftrsvLTU( N, A, LDA, X, INCX );
}
}
}
/*
- * End of ATL_dreftpsv
+ * End of ATL_dreftrsv
*/
}
View
26 scikits/learn/src/cblas/ATL_dreftpsvLNU.c → scikits/learn/src/cblas/ATL_dreftrsvLNN.c
@@ -3,14 +3,11 @@
* -- Automatically Tuned Linear Algebra Software (ATLAS)
* (C) Copyright 2000 All Rights Reserved
*
- * -- ATLAS routine -- Version 3.2 -- December 25, 2000
- *
- * -- Suggestions, comments, bugs reports should be sent to the follo-
- * wing e-mail address: atlas@cs.utk.edu
+ * -- ATLAS routine -- Version 3.9.24 -- December 25, 2000
*
* Author : Antoine P. Petitet
- * University of Tennessee - Innovative Computing Laboratory
- * Knoxville TN, 37996-1301, USA.
+ * Originally developed at the University of Tennessee,
+ * Innovative Computing Laboratory, Knoxville TN, 37996-1301, USA.
*
* ---------------------------------------------------------------------
*
@@ -53,7 +50,7 @@
#include "atlas_reflvl2.h"
#include "atlas_reflevel2.h"
-void ATL_dreftpsvLNU
+void ATL_dreftrsvLNN
(
const int N,
const double * A,
@@ -66,13 +63,13 @@ void ATL_dreftpsvLNU
* Purpose
* =======
*
- * ATL_dreftpsvLNU( ... )
+ * ATL_dreftrsvLNN( ... )
*
* <=>
*
- * ATL_dreftpsv( AtlasLower, AtlasNoTrans, AtlasUnit, ... )
+ * ATL_dreftrsv( AtlasLower, AtlasNoTrans, AtlasNonUnit, ... )
*
- * See ATL_dreftpsv for details.
+ * See ATL_dreftrsv for details.
*
* ---------------------------------------------------------------------
*/
@@ -80,19 +77,18 @@ void ATL_dreftpsvLNU
* .. Local Variables ..
*/
register double t0;
- int i, iaij, ix, j, jaj, jx, lda = LDA;
+ int i, iaij, ix, j, jaj, jx, ldap1 = LDA + 1;
/* ..
* .. Executable Statements ..
*
*/
- for( j = 0, jaj = 0, jx = 0; j < N; j++, jx += INCX )
+ for( j = 0, jaj = 0, jx = 0; j < N; j++, jaj += ldap1, jx += INCX )
{
- t0 = X[jx];
+ X[jx] /= A[jaj]; t0 = X[jx];
for( i = j+1, iaij = jaj+1, ix = jx + INCX;
i < N; i++, iaij += 1, ix += INCX ) { X[ix] -= t0 * A[iaij]; }
- jaj += lda; lda -= 1;
}
/*
- * End of ATL_dreftpsvLNU
+ * End of ATL_dreftrsvLNN
*/
}
View
30 scikits/learn/src/cblas/ATL_dreftpsvLNN.c → scikits/learn/src/cblas/ATL_dreftrsvLNU.c
@@ -3,14 +3,11 @@
* -- Automatically Tuned Linear Algebra Software (ATLAS)
* (C) Copyright 2000 All Rights Reserved
*
- * -- ATLAS routine -- Version 3.2 -- December 25, 2000
- *
- * -- Suggestions, comments, bugs reports should be sent to the follo-
- * wing e-mail address: atlas@cs.utk.edu
+ * -- ATLAS routine -- Version 3.9.24 -- December 25, 2000
*
* Author : Antoine P. Petitet
- * University of Tennessee - Innovative Computing Laboratory
- * Knoxville TN, 37996-1301, USA.
+ * Originally developed at the University of Tennessee,
+ * Innovative Computing Laboratory, Knoxville TN, 37996-1301, USA.
*
* ---------------------------------------------------------------------
*
@@ -53,7 +50,7 @@
#include "atlas_reflvl2.h"
#include "atlas_reflevel2.h"
-void ATL_dreftpsvLNN
+void ATL_dreftrsvLNU
(
const int N,
const double * A,
@@ -66,13 +63,13 @@ void ATL_dreftpsvLNN
* Purpose
* =======
*
- * ATL_dreftpsvLNN( ... )
+ * ATL_dreftrsvLNU( ... )
*
* <=>
*
- * ATL_dreftpsv( AtlasLower, AtlasNoTrans, AtlasNonUnit, ... )
+ * ATL_dreftrsv( AtlasLower, AtlasNoTrans, AtlasUnit, ... )
*
- * See ATL_dreftpsv for details.
+ * See ATL_dreftrsv for details.
*
* ---------------------------------------------------------------------
*/
@@ -80,19 +77,18 @@ void ATL_dreftpsvLNN
* .. Local Variables ..
*/
register double t0;
- int i, iaij, ix, j, jaj, jx, lda = LDA;
+ int i, iaij, ix, j, jaj, jx, ldap1 = LDA + 1;
/* ..
* .. Executable Statements ..
*
*/
- for( j = 0, jaj = 0, jx = 0; j < N; j++, jx += INCX )
+ for( j = 0, jaj = 0, jx = 0; j < N; j++, jaj += ldap1, jx += INCX )
{
- X[jx] /= A[jaj]; t0 = X[jx];
- for( i = j+1, iaij = jaj+1, ix = jx + INCX; i < N;
- i++, iaij += 1, ix += INCX ) { X[ix] -= t0 * A[iaij]; }
- jaj += lda; lda -= 1;
+ t0 = X[jx];
+ for( i = j+1, iaij = jaj+1, ix = jx + INCX;
+ i < N; i++, iaij += 1, ix += INCX ) { X[ix] -= t0 * A[iaij]; }
}
/*
- * End of ATL_dreftpsvLNN
+ * End of ATL_dreftrsvLNU
*/
}
View
96 scikits/learn/src/cblas/ATL_dreftrsvLTN.c
@@ -0,0 +1,96 @@
+/* ---------------------------------------------------------------------
+ *
+ * -- Automatically Tuned Linear Algebra Software (ATLAS)
+ * (C) Copyright 2000 All Rights Reserved
+ *
+ * -- ATLAS routine -- Version 3.9.24 -- December 25, 2000
+ *
+ * Author : Antoine P. Petitet
+ * Originally developed at the University of Tennessee,
+ * Innovative Computing Laboratory, Knoxville TN, 37996-1301, USA.
+ *
+ * ---------------------------------------------------------------------
+ *
+ * -- Copyright notice and Licensing terms:
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions, and the following disclaimer in
+ * the documentation and/or other materials provided with the distri-
+ * bution.
+ * 3. The name of the University, the ATLAS group, or the names of its
+ * contributors may not be used to endorse or promote products deri-
+ * ved from this software without specific written permission.
+ *
+ * -- Disclaimer:
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE-
+ * CIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+ * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEO-
+ * RY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (IN-
+ * CLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * ---------------------------------------------------------------------
+ */
+/*
+ * Include files
+ */
+#include "atlas_refmisc.h"
+#include "atlas_reflvl2.h"
+#include "atlas_reflevel2.h"
+
+void ATL_dreftrsvLTN
+(
+ const int N,
+ const double * A,
+ const int LDA,
+ double * X,
+ const int INCX
+)
+{
+/*
+ * Purpose
+ * =======
+ *
+ * ATL_dreftrsvLTN( ... )
+ *
+ * <=>
+ *
+ * ATL_dreftrsv( AtlasLower, AtlasTrans, AtlasNonUnit, ... )
+ *
+ * See ATL_dreftrsv for details.
+ *
+ * ---------------------------------------------------------------------
+ */
+/*
+ * .. Local Variables ..
+ */
+ register double t0;
+ int i, iaij, ix, j, jaj, jx, ldap1 = LDA + 1;
+/* ..
+ * .. Executable Statements ..
+ *
+ */
+ for( j = N-1, jaj = (N-1)*(ldap1), jx = (N-1)*INCX;
+ j >= 0; j--, jaj -= ldap1, jx -= INCX )
+ {
+ t0 = X[jx];
+ for( i = j+1, iaij = 1+jaj, ix = jx + INCX;
+ i < N; i++, iaij += 1, ix += INCX ) { t0 -= A[iaij] * X[ix]; }
+ t0 /= A[jaj]; X[jx] = t0;
+ }
+/*
+ * End of ATL_dreftrsvLTN
+ */
+}
View
96 scikits/learn/src/cblas/ATL_dreftrsvLTU.c
@@ -0,0 +1,96 @@
+/* ---------------------------------------------------------------------
+ *
+ * -- Automatically Tuned Linear Algebra Software (ATLAS)
+ * (C) Copyright 2000 All Rights Reserved
+ *
+ * -- ATLAS routine -- Version 3.9.24 -- December 25, 2000
+ *
+ * Author : Antoine P. Petitet
+ * Originally developed at the University of Tennessee,
+ * Innovative Computing Laboratory, Knoxville TN, 37996-1301, USA.
+ *
+ * ---------------------------------------------------------------------
+ *
+ * -- Copyright notice and Licensing terms:
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions, and the following disclaimer in
+ * the documentation and/or other materials provided with the distri-
+ * bution.
+ * 3. The name of the University, the ATLAS group, or the names of its
+ * contributors may not be used to endorse or promote products deri-
+ * ved from this software without specific written permission.
+ *
+ * -- Disclaimer:
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE-
+ * CIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+ * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEO-
+ * RY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (IN-
+ * CLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * ---------------------------------------------------------------------
+ */
+/*
+ * Include files
+ */
+#include "atlas_refmisc.h"
+#include "atlas_reflvl2.h"
+#include "atlas_reflevel2.h"
+
+void ATL_dreftrsvLTU
+(
+ const int N,
+ const double * A,
+ const int LDA,
+ double * X,
+ const int INCX
+)
+{
+/*
+ * Purpose
+ * =======
+ *
+ * ATL_dreftrsvLTU( ... )
+ *
+ * <=>
+ *
+ * ATL_dreftrsv( AtlasLower, AtlasTrans, AtlasUnit, ... )
+ *
+ * See ATL_dreftrsv for details.
+ *
+ * ---------------------------------------------------------------------
+ */
+/*
+ * .. Local Variables ..
+ */
+ register double t0;
+ int i, iaij, ix, j, jaj, jx, ldap1 = LDA + 1;
+/* ..
+ * .. Executable Statements ..
+ *
+ */
+ for( j = N-1, jaj = (N-1)*(ldap1), jx = (N-1)*INCX;
+ j >= 0; j--, jaj -= ldap1, jx -= INCX )
+ {
+ t0 = X[jx];
+ for( i = j+1, iaij = 1+jaj, ix = jx + INCX;
+ i < N; i++, iaij += 1, ix += INCX ) { t0 -= A[iaij] * X[ix]; }
+ X[jx] = t0;
+ }
+/*
+ * End of ATL_dreftrsvLTU
+ */
+}
View
26 scikits/learn/src/cblas/ATL_dreftpsvUNN.c → scikits/learn/src/cblas/ATL_dreftrsvUNN.c
@@ -3,14 +3,11 @@
* -- Automatically Tuned Linear Algebra Software (ATLAS)
* (C) Copyright 2000 All Rights Reserved
*
- * -- ATLAS routine -- Version 3.2 -- December 25, 2000
- *
- * -- Suggestions, comments, bugs reports should be sent to the follo-
- * wing e-mail address: atlas@cs.utk.edu
+ * -- ATLAS routine -- Version 3.9.24 -- December 25, 2000
*
* Author : Antoine P. Petitet
- * University of Tennessee - Innovative Computing Laboratory
- * Knoxville TN, 37996-1301, USA.
+ * Originally developed at the University of Tennessee,
+ * Innovative Computing Laboratory, Knoxville TN, 37996-1301, USA.
*
* ---------------------------------------------------------------------
*
@@ -53,7 +50,7 @@
#include "atlas_reflvl2.h"
#include "atlas_reflevel2.h"
-void ATL_dreftpsvUNN
+void ATL_dreftrsvUNN
(
const int N,
const double * A,
@@ -66,13 +63,13 @@ void ATL_dreftpsvUNN
* Purpose
* =======
*
- * ATL_dreftpsvUNN( ... )
+ * ATL_dreftrsvUNN( ... )
*
* <=>
*
- * ATL_dreftpsv( AtlasUpper, AtlasNoTrans, AtlasNonUnit, ... )
+ * ATL_dreftrsv( AtlasUpper, AtlasNoTrans, AtlasNonUnit, ... )
*
- * See ATL_dreftpsv for details.
+ * See ATL_dreftrsv for details.
*
* ---------------------------------------------------------------------
*/
@@ -80,20 +77,19 @@ void ATL_dreftpsvUNN
* .. Local Variables ..
*/
register double t0;
- int i, iaij, ix, j, jaj, jx, lda = LDA + N - 1;
+ int i, iaij, ix, j, jaj, jx;
/* ..
* .. Executable Statements ..
*
*/
- for( j = N-1, jaj = (((N-1)*(2*LDA+N-2)) >> 1), jx = (N-1)*INCX;
- j >= 0; j--, jx -= INCX )
+ for( j = N-1, jaj = (N-1)*LDA, jx = (N-1)*INCX;
+ j >= 0; j--, jaj -= LDA, jx -= INCX )
{
X[jx] /= A[j+jaj]; t0 = X[jx];
for( i = 0, iaij = jaj, ix = 0; i < j; i++, iaij += 1, ix += INCX )
{ X[ix] -= t0 * A[iaij]; }
- lda -= 1; jaj -= lda;
}
/*
- * End of ATL_dreftpsvUNN
+ * End of ATL_dreftrsvUNN
*/
}
View
26 scikits/learn/src/cblas/ATL_dreftpsvUNU.c → scikits/learn/src/cblas/ATL_dreftrsvUNU.c
@@ -3,14 +3,11 @@
* -- Automatically Tuned Linear Algebra Software (ATLAS)
* (C) Copyright 2000 All Rights Reserved
*
- * -- ATLAS routine -- Version 3.2 -- December 25, 2000
- *
- * -- Suggestions, comments, bugs reports should be sent to the follo-
- * wing e-mail address: atlas@cs.utk.edu
+ * -- ATLAS routine -- Version 3.9.24 -- December 25, 2000
*
* Author : Antoine P. Petitet
- * University of Tennessee - Innovative Computing Laboratory
- * Knoxville TN, 37996-1301, USA.
+ * Originally developed at the University of Tennessee,
+ * Innovative Computing Laboratory, Knoxville TN, 37996-1301, USA.
*
* ---------------------------------------------------------------------
*
@@ -53,7 +50,7 @@
#include "atlas_reflvl2.h"
#include "atlas_reflevel2.h"
-void ATL_dreftpsvUNU
+void ATL_dreftrsvUNU
(
const int N,
const double * A,
@@ -66,13 +63,13 @@ void ATL_dreftpsvUNU
* Purpose
* =======
*
- * ATL_dreftpsvUNU( ... )
+ * ATL_dreftrsvUNU( ... )
*
* <=>
*
- * ATL_dreftpsv( AtlasUpper, AtlasNoTrans, AtlasUnit, ... )
+ * ATL_dreftrsv( AtlasUpper, AtlasNoTrans, AtlasUnit, ... )
*
- * See ATL_dreftpsv for details.
+ * See ATL_dreftrsv for details.
*
* ---------------------------------------------------------------------
*/
@@ -80,20 +77,19 @@ void ATL_dreftpsvUNU
* .. Local Variables ..
*/
register double t0;
- int i, iaij, ix, j, jaj, jx, lda = LDA + N - 1;
+ int i, iaij, ix, j, jaj, jx;
/* ..
* .. Executable Statements ..
*
*/
- for( j = N-1, jaj = (((N-1)*(2*LDA+N-2)) >> 1), jx = (N-1)*INCX;
- j >= 0; j--, jx -= INCX )
+ for( j = N-1, jaj = (N-1)*LDA, jx = (N-1)*INCX;
+ j >= 0; j--, jaj -= LDA, jx -= INCX )
{
t0 = X[jx];
for( i = 0, iaij = jaj, ix = 0; i < j; i++, iaij += 1, ix += INCX )
{ X[ix] -= t0 * A[iaij]; }
- lda -= 1; jaj -= lda;
}
/*
- * End of ATL_dreftpsvUNU
+ * End of ATL_dreftrsvUNU
*/
}
View
25 scikits/learn/src/cblas/ATL_dreftpsvUTU.c → scikits/learn/src/cblas/ATL_dreftrsvUTN.c
@@ -3,14 +3,11 @@
* -- Automatically Tuned Linear Algebra Software (ATLAS)
* (C) Copyright 2000 All Rights Reserved
*
- * -- ATLAS routine -- Version 3.2 -- December 25, 2000
- *
- * -- Suggestions, comments, bugs reports should be sent to the follo-
- * wing e-mail address: atlas@cs.utk.edu
+ * -- ATLAS routine -- Version 3.9.24 -- December 25, 2000
*
* Author : Antoine P. Petitet
- * University of Tennessee - Innovative Computing Laboratory
- * Knoxville TN, 37996-1301, USA.
+ * Originally developed at the University of Tennessee,
+ * Innovative Computing Laboratory, Knoxville TN, 37996-1301, USA.
*
* ---------------------------------------------------------------------
*
@@ -53,7 +50,7 @@
#include "atlas_reflvl2.h"
#include "atlas_reflevel2.h"
-void ATL_dreftpsvUTU
+void ATL_dreftrsvUTN
(
const int N,
const double * A,
@@ -66,13 +63,13 @@ void ATL_dreftpsvUTU
* Purpose
* =======
*
- * ATL_dreftpsvUTU( ... )
+ * ATL_dreftrsvUTN( ... )
*
* <=>
*
- * ATL_dreftpsv( AtlasUpper, AtlasTrans, AtlasUnit, ... )
+ * ATL_dreftrsv( AtlasUpper, AtlasTrans, AtlasNonUnit, ... )
*
- * See ATL_dreftpsv for details.
+ * See ATL_dreftrsv for details.
*
* ---------------------------------------------------------------------
*/
@@ -80,19 +77,19 @@ void ATL_dreftpsvUTU
* .. Local Variables ..
*/
register double t0;
- int i, iaij, ix, j, jaj, jx, lda = LDA;
+ int i, iaij, ix, j, jaj, jx;
/* ..
* .. Executable Statements ..
*
*/
- for( j = 0, jaj = 0, jx = 0; j < N; j++, jx += INCX )
+ for( j = 0, jaj = 0,jx = 0; j < N; j++, jaj += LDA, jx += INCX )
{
t0 = X[jx];
for( i = 0, iaij = jaj, ix = 0; i < j; i++, iaij += 1, ix += INCX )
{ t0 -= A[iaij] * X[ix]; }
- X[jx] = t0; jaj += lda; lda += 1;
+ t0 /= A[iaij]; X[jx] = t0;
}
/*
- * End of ATL_dreftpsvUTU
+ * End of ATL_dreftrsvUTN
*/
}
View
25 scikits/learn/src/cblas/ATL_dreftpsvUTN.c → scikits/learn/src/cblas/ATL_dreftrsvUTU.c
@@ -3,14 +3,11 @@
* -- Automatically Tuned Linear Algebra Software (ATLAS)
* (C) Copyright 2000 All Rights Reserved
*
- * -- ATLAS routine -- Version 3.2 -- December 25, 2000
- *
- * -- Suggestions, comments, bugs reports should be sent to the follo-
- * wing e-mail address: atlas@cs.utk.edu
+ * -- ATLAS routine -- Version 3.9.24 -- December 25, 2000
*
* Author : Antoine P. Petitet
- * University of Tennessee - Innovative Computing Laboratory
- * Knoxville TN, 37996-1301, USA.
+ * Originally developed at the University of Tennessee,
+ * Innovative Computing Laboratory, Knoxville TN, 37996-1301, USA.
*
* ---------------------------------------------------------------------
*
@@ -53,7 +50,7 @@
#include "atlas_reflvl2.h"
#include "atlas_reflevel2.h"
-void ATL_dreftpsvUTN
+void ATL_dreftrsvUTU
(
const int N,
const double * A,
@@ -66,13 +63,13 @@ void ATL_dreftpsvUTN
* Purpose
* =======
*
- * ATL_dreftpsvUTN( ... )
+ * ATL_dreftrsvUTU( ... )
*
* <=>
*
- * ATL_dreftpsv( AtlasUpper, AtlasTrans, AtlasNonUnit, ... )
+ * ATL_dreftrsv( AtlasUpper, AtlasTrans, AtlasUnit, ... )
*
- * See ATL_dreftpsv for details.
+ * See ATL_dreftrsv for details.
*
* ---------------------------------------------------------------------
*/
@@ -80,19 +77,19 @@ void ATL_dreftpsvUTN
* .. Local Variables ..
*/
register double t0;
- int i, iaij, ix, j, jaj, jx, lda = LDA;
+ int i, iaij, ix, j, jaj, jx;
/* ..
* .. Executable Statements ..
*
*/
- for( j = 0, jaj = 0, jx = 0; j < N; j++, jx += INCX )
+ for( j = 0, jaj = 0, jx = 0; j < N; j++, jaj += LDA, jx += INCX )
{
t0 = X[jx];
for( i = 0, iaij = jaj, ix = 0; i < j; i++, iaij += 1, ix += INCX )
{ t0 -= A[iaij] * X[ix]; }
- t0 /= A[iaij]; X[jx] = t0; jaj += lda; lda += 1;
+ X[jx] = t0;
}
/*
- * End of ATL_dreftpsvUTN
+ * End of ATL_dreftrsvUTU
*/
}
View
942 scikits/learn/src/cblas/atlas_aux.h
@@ -0,0 +1,942 @@
+/*
+ * Automatically Tuned Linear Algebra Software v3.9.25
+ * (C) Copyright 1999 R. Clint Whaley
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions, and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the ATLAS group or the names of its contributers may
+ * not be used to endorse or promote products derived from this
+ * software without specific written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ATLAS GROUP OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+/*
+ * Header file for ATLAS's auxiliary routines
+ */
+#ifndef ATLAS_AUX_H
+#define ATLAS_AUX_H
+#include "atlas_misc.h"
+
+void ATL_xerbla(int p, char *rout, char *form, ...);
+int ATL_lcm(const int M, const int N);
+double ATL_walltime();
+double ATL_cputime();
+
+/*
+ * Auxiliary routines that come in all four types
+ */
+void ATL_sgeset(ATL_CINT M, ATL_CINT N, const float alpha,
+ const float beta, float *A, ATL_CINT lda);
+void ATL_strsetL(ATL_CINT M, ATL_CINT N, const float alpha,
+ const float beta, float *A, ATL_CINT lda);
+void ATL_strsetU(ATL_CINT M, ATL_CINT N, const float alpha,
+ const float beta, float *A, ATL_CINT lda);
+float ATL_sgemaxnrm(ATL_CINT M, ATL_CINT N, float *A, ATL_CINT lda);
+void ATL_sgeadd(const int M, const int N, const float alpha,
+ const float *A, const int lda, const float beta,
+ float *C, const int ldc);
+void ATL_sgemove(const int M, const int N, const float alpha,
+ const float *A, const int lda, float *C, const int ldc);
+void ATL_sgemoveT(const int N, const int M, const float alpha,
+ const float *A, const int lda, float *C, const int ldc);
+void ATL_ssyreflect(const enum ATLAS_UPLO Uplo, const int N,
+ float *C, const int ldc);
+void ATL_sgecopy(const int M, const int N, const float *A, const int lda,
+ float *C, const int ldc);
+
+void ATL_sgescal(const int M, const int N, const float beta,
+ float *C, const int ldc);
+void ATL_stradd
+ (const enum ATLAS_UPLO Uplo, ATL_CINT N, const float *A, ATL_CINT lda,
+ const float beta, float *C, ATL_CINT ldc);
+void ATL_strscal
+ (const enum ATLAS_UPLO Uplo, const int M, const int N, const float alpha,
+ float *A, const int lda);
+void ATL_shescal
+ (const enum ATLAS_UPLO Uplo, const int M, const int N, const float alpha,
+ float *A, const int lda);
+
+void ATL_sgezero(const int M, const int N, float *C, const int ldc);
+void ATL_ssyApAt_NB
+ (const enum ATLAS_UPLO Uplo, ATL_CINT N, const float *A, ATL_CINT lda,
+ const float beta, float *C, ATL_CINT ldc);
+void ATL_ssyApAt
+ (const enum ATLAS_UPLO Uplo, ATL_CINT N, const float *A, ATL_CINT lda,
+ const float beta, float *C, ATL_CINT ldc);
+void ATL_sgeApBt_NB
+ (ATL_CINT M, ATL_CINT N, const float *A, ATL_CINT lda,
+ const float *B, ATL_CINT ldb, const float beta, float *C, ATL_CINT ldc);
+void ATL_sgeswapT(ATL_CINT M, ATL_CINT N, float *A, ATL_CINT lda,
+ float *B, ATL_CINT ldb);
+void ATL_ssqtrans(ATL_CINT N, float *C, ATL_CINT ldc);
+
+void ATL_szero(const int N, float *X, const int incX);
+void ATL_sset(const int N, const float alpha, float *X, const int incX);
+void ATL_sscal(const int N, const float alpha, float *X, const int incX);
+void ATL_scopy(const int N, const float *X, const int incX,
+ float *Y, const int incY);
+void ATL_scpsc(const int N, const float alpha, const float *X,
+ const int incX, float *Y, const int incY);
+void ATL_saxpy(const int N, const float alpha, const float *X,
+ const int incX, float *Y, const int incY);
+void ATL_saxpy_x1_y1(const int N, const float alpha, const float *X,
+ const int incX, float *Y, const int incY);
+void ATL_saxpby(const int N, const float alpha, const float *X,
+ const int incX, const float beta, float *Y, const int incY);
+
+void ATL_sgeadd_a1_b1
+ (ATL_CINT M, ATL_CINT N, const float alpha, const float *A,
+ ATL_CINT lda, const float beta, float *C, ATL_CINT ldc);
+void ATL_saxpby_a1_b1
+ (ATL_CINT N, const float alpha, const float *X, ATL_CINT incX,
+ const float beta, float *Y, ATL_CINT incY);
+void ATL_sgeadd_a0_b1
+ (ATL_CINT M, ATL_CINT N, const float alpha, const float *A,
+ ATL_CINT lda, const float beta, float *C, ATL_CINT ldc);
+void ATL_saxpby_a0_b1
+ (ATL_CINT N, const float alpha, const float *X, ATL_CINT incX,
+ const float beta, float *Y, ATL_CINT incY);
+void ATL_sgeadd_aX_b1
+ (ATL_CINT M, ATL_CINT N, const float alpha, const float *A,
+ ATL_CINT lda, const float beta, float *C, ATL_CINT ldc);
+void ATL_saxpby_aX_b1
+ (ATL_CINT N, const float alpha, const float *X, ATL_CINT incX,
+ const float beta, float *Y, ATL_CINT incY);
+void ATL_sgeadd_a1_b0
+ (ATL_CINT M, ATL_CINT N, const float alpha, const float *A,
+ ATL_CINT lda, const float beta, float *C, ATL_CINT ldc);
+void ATL_saxpby_a1_b0
+ (ATL_CINT N, const float alpha, const float *X, ATL_CINT incX,
+ const float beta, float *Y, ATL_CINT incY);
+void ATL_sgeadd_a0_b0
+ (ATL_CINT M, ATL_CINT N, const float alpha, const float *A,
+ ATL_CINT lda, const float beta, float *C, ATL_CINT ldc);
+void ATL_saxpby_a0_b0
+ (ATL_CINT N, const float alpha, const float *X, ATL_CINT incX,
+ const float beta, float *Y, ATL_CINT incY);
+void ATL_sgeadd_aX_b0
+ (ATL_CINT M, ATL_CINT N, const float alpha, const float *A,
+ ATL_CINT lda, const float beta, float *C, ATL_CINT ldc);
+void ATL_saxpby_aX_b0
+ (ATL_CINT N, const float alpha, const float *X, ATL_CINT incX,
+ const float beta, float *Y, ATL_CINT incY);
+void ATL_sgeadd_a1_bX
+ (ATL_CINT M, ATL_CINT N, const float alpha, const float *A,
+ ATL_CINT lda, const float beta, float *C, ATL_CINT ldc);
+void ATL_saxpby_a1_bX
+ (ATL_CINT N, const float alpha, const float *X, ATL_CINT incX,
+ const float beta, float *Y, ATL_CINT incY);
+void ATL_sgeadd_a0_bX
+ (ATL_CINT M, ATL_CINT N, const float alpha, const float *A,
+ ATL_CINT lda, const float beta, float *C, ATL_CINT ldc);
+void ATL_saxpby_a0_bX
+ (ATL_CINT N, const float alpha, const float *X, ATL_CINT incX,
+ const float beta, float *Y, ATL_CINT incY);
+void ATL_sgeadd_aX_bX
+ (ATL_CINT M, ATL_CINT N, const float alpha, const float *A,
+ ATL_CINT lda, const float beta, float *C, ATL_CINT ldc);
+void ATL_saxpby_aX_bX