IpBlas.hpp 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. // Copyright (C) 2004, 2006 International Business Machines and others.
  2. // All Rights Reserved.
  3. // This code is published under the Eclipse Public License.
  4. //
  5. // $Id: IpBlas.hpp 1861 2010-12-21 21:34:47Z andreasw $
  6. //
  7. // Authors: Carl Laird, Andreas Waechter IBM 2004-08-13
  8. #ifndef __IPBLAS_HPP__
  9. #define __IPBLAS_HPP__
  10. #include "IpUtils.hpp"
  11. namespace Ipopt
  12. {
  13. // If CBLAS is not available, this is our own interface to the Fortran
  14. // implementation
  15. /** Wrapper for BLAS function DDOT. Compute dot product of vector x
  16. and vector y */
  17. Number IpBlasDdot(Index size, const Number *x, Index incX, const Number *y,
  18. Index incY);
  19. /** Wrapper for BLAS function DNRM2. Compute 2-norm of vector x*/
  20. Number IpBlasDnrm2(Index size, const Number *x, Index incX);
  21. /** Wrapper for BLAS function DASUM. Compute 1-norm of vector x*/
  22. Number IpBlasDasum(Index size, const Number *x, Index incX);
  23. /** Wrapper for BLAS function IDAMAX. Compute index for largest
  24. absolute element of vector x */
  25. Index IpBlasIdamax(Index size, const Number *x, Index incX);
  26. /** Wrapper for BLAS subroutine DCOPY. Copying vector x into vector
  27. y */
  28. void IpBlasDcopy(Index size, const Number *x, Index incX, Number *y,
  29. Index incY);
  30. /** Wrapper for BLAS subroutine DAXPY. Adding the alpha multiple of
  31. vector x to vector y */
  32. void IpBlasDaxpy(Index size, Number alpha, const Number *x, Index incX,
  33. Number *y, Index incY);
  34. /** Wrapper for BLAS subroutine DSCAL. Scaling vector x by scalar
  35. alpha */
  36. void IpBlasDscal(Index size, Number alpha, Number *x, Index incX);
  37. /** Wrapper for BLAS subroutine DGEMV. Multiplying a matrix with a
  38. vector. */
  39. void IpBlasDgemv(bool trans, Index nRows, Index nCols, Number alpha,
  40. const Number* A, Index ldA, const Number* x,
  41. Index incX, Number beta, Number* y, Index incY);
  42. /** Wrapper for BLAS subroutine DSYMV. Multiplying a symmetric
  43. matrix with a vector. */
  44. void IpBlasDsymv(Index n, Number alpha, const Number* A, Index ldA,
  45. const Number* x, Index incX, Number beta, Number* y,
  46. Index incY);
  47. /** Wrapper for BLAS subroutine DGEMM. Multiplying two matrices */
  48. void IpBlasDgemm(bool transa, bool transb, Index m, Index n, Index k,
  49. Number alpha, const Number* A, Index ldA, const Number* B,
  50. Index ldB, Number beta, Number* C, Index ldC);
  51. /** Wrapper for BLAS subroutine DSYRK. Adding a high-rank update to
  52. * a matrix */
  53. void IpBlasDsyrk(bool trans, Index ndim, Index nrank,
  54. Number alpha, const Number* A, Index ldA,
  55. Number beta, Number* C, Index ldC);
  56. /** Wrapper for BLAS subroutine DTRSM. Backsolve for a lower triangular
  57. * matrix. */
  58. void IpBlasDtrsm(bool trans, Index ndim, Index nrhs, Number alpha,
  59. const Number* A, Index ldA, Number* B, Index ldB);
  60. } // namespace Ipopt
  61. #endif