~ubuntu-branches/ubuntu/maverick/openturns/maverick

« back to all changes in this revision

Viewing changes to lib/src/Base/Type/Kronecker.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme
  • Date: 2008-11-18 06:32:22 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20081118063222-pa0qncclrerrqkg2
Tags: 0.12.2-1
* New upstream release
* Bug fix: "New upstream release available (0.12.2)", thanks to Jerome
  Robert (Closes: #506005).
* Applied patch by J. Robert.
* debian/control: build-depends on libxml2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//                                               -*- C++ -*-
2
 
/**
3
 
 *  @file  Kronecker.cxx
4
 
 *  @brief Kronecker implements the Kronecker product of two vectors
5
 
 *
6
 
 *  (C) Copyright 2005-2007 EDF-EADS-Phimeca
7
 
 *
8
 
 *  This library is free software; you can redistribute it and/or
9
 
 *  modify it under the terms of the GNU Lesser General Public
10
 
 *  License as published by the Free Software Foundation; either
11
 
 *  version 2.1 of the License.
12
 
 *
13
 
 *  This library is distributed in the hope that it will be useful
14
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16
 
 *  Lesser General Public License for more details.
17
 
 *
18
 
 *  You should have received a copy of the GNU Lesser General Public
19
 
 *  License along with this library; if not, write to the Free Software
20
 
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
21
 
 *
22
 
 *  @author: $LastChangedBy: dutka $
23
 
 *  @date:   $LastChangedDate: 2008-06-26 13:50:17 +0200 (jeu, 26 jun 2008) $
24
 
 *  Id:      $Id: Kronecker.cxx 862 2008-06-26 11:50:17Z dutka $
25
 
 */
26
 
 
27
 
#include "Lapack.hxx"
28
 
#include "NumericalPoint.hxx"
29
 
#include "Matrix.hxx"
30
 
 
31
 
namespace OpenTURNS
32
 
{
33
 
 
34
 
  namespace Base
35
 
  {
36
 
 
37
 
    namespace Type
38
 
    {
39
 
 
40
 
      Matrix kronecker(NumericalPoint & vect1, NumericalPoint & vect2)
41
 
      {
42
 
        int m = vect1.getDimension();
43
 
        int n = vect2.getDimension();
44
 
        int one = 1;
45
 
        double alpha = 1.0;
46
 
        Matrix A(m,n);
47
 
  
48
 
        DGER_F77(&m, &n, &alpha, &vect1[0], &one, &vect2[0], &one, &A(0,0), &m);
49
 
 
50
 
        return A;
51
 
      }
52
 
 
53
 
    } /* namespace Type */
54
 
  } /* namespace Base */
55
 
} /* namespace OpenTURNS */