mirror of
https://github.com/boostorg/ublas.git
synced 2026-02-22 03:42:19 +00:00
More bug fixes.
This commit is contained in:
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/banded.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/banded.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/storage.hpp>
|
||||
|
||||
int main () {
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/matrix_sparse.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/vector_sparse.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/matrix_sparse.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/vector_sparse.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/hermitian.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/hermitian.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/matrix.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/storage_sparse.hpp>
|
||||
|
||||
int main () {
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/matrix.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/matrix.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/matrix.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/matrix.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/matrix.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/matrix.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/triangular.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/matrix.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/matrix.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/matrix.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/matrix.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/matrix.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/matrix.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/matrix.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/matrix.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/matrix.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/matrix.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/triangular.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/storage.hpp>
|
||||
|
||||
int main () {
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/storage.hpp>
|
||||
|
||||
int main () {
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/matrix_sparse.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/vector_sparse.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/symmetric.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/symmetric.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/triangular.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/triangular.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/storage.hpp>
|
||||
|
||||
int main () {
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/vector.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/vector.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/vector.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/matrix.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/vector.hpp>
|
||||
|
||||
int main () {
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/vector.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/vector.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/vector.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/vector.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/vector.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/vector.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/vector.hpp>
|
||||
|
||||
int main () {
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/matrix.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
//
|
||||
// Copyright (c) 2000-2002
|
||||
// Joerg Walter, Mathias Koch
|
||||
//
|
||||
// Permission to use, copy, modify, distribute and sell this software
|
||||
// and its documentation for any purpose is hereby granted without fee,
|
||||
// provided that the above copyright notice appear in all copies and
|
||||
// that both that copyright notice and this permission notice appear
|
||||
// in supporting documentation. The authors make no representations
|
||||
// about the suitability of this software for any purpose.
|
||||
// It is provided "as is" without express or implied warranty.
|
||||
//
|
||||
// The authors gratefully acknowledge the support of
|
||||
// GeNeSys mbH & Co. KG in producing this work.
|
||||
//
|
||||
|
||||
#include <boost/numeric/ublas/vector.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
|
||||
@@ -1082,6 +1082,8 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
static
|
||||
BOOST_UBLAS_INLINE
|
||||
size_type element (size_type i, size_type size1, size_type j, size_type size2) {
|
||||
// Guarding against overflow.
|
||||
BOOST_UBLAS_CHECK ((size1 * size2) / size1 == size2, bad_size ());
|
||||
BOOST_UBLAS_CHECK (i < size1, bad_index ());
|
||||
BOOST_UBLAS_CHECK (j < size2, bad_index ());
|
||||
return i * size2 + j;
|
||||
@@ -1089,6 +1091,8 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
static
|
||||
BOOST_UBLAS_INLINE
|
||||
size_type address (size_type i, size_type size1, size_type j, size_type size2) {
|
||||
// Guarding against overflow.
|
||||
BOOST_UBLAS_CHECK ((size1 * size2) / size1 == size2, bad_size ());
|
||||
BOOST_UBLAS_CHECK (i <= size1, bad_index ());
|
||||
BOOST_UBLAS_CHECK (j <= size2, bad_index ());
|
||||
return i * size2 + j;
|
||||
@@ -1238,6 +1242,8 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
static
|
||||
BOOST_UBLAS_INLINE
|
||||
size_type element (size_type i, size_type size1, size_type j, size_type size2) {
|
||||
// Guarding against overflow.
|
||||
BOOST_UBLAS_CHECK ((size1 * size2) / size1 == size2, bad_size ());
|
||||
BOOST_UBLAS_CHECK (i < size1, bad_index ());
|
||||
BOOST_UBLAS_CHECK (j < size2, bad_index ());
|
||||
return i + j * size1;
|
||||
@@ -1245,6 +1251,8 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
static
|
||||
BOOST_UBLAS_INLINE
|
||||
size_type address (size_type i, size_type size1, size_type j, size_type size2) {
|
||||
// Guarding against overflow.
|
||||
BOOST_UBLAS_CHECK ((size1 * size2) / size1 == size2, bad_size ());
|
||||
BOOST_UBLAS_CHECK (i <= size1, bad_index ());
|
||||
BOOST_UBLAS_CHECK (j <= size2, bad_index ());
|
||||
return i + j * size1;
|
||||
|
||||
@@ -1298,7 +1298,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
// Assignment
|
||||
BOOST_UBLAS_INLINE
|
||||
hermitian_adaptor &operator = (const hermitian_adaptor &m) {
|
||||
matrix_assign (scalar_assign<value_type, value_type> (), *this, m);
|
||||
matrix_assign (scalar_assign<value_type, value_type> (), *this, m, functor_type ());
|
||||
return *this;
|
||||
}
|
||||
BOOST_UBLAS_INLINE
|
||||
@@ -1309,37 +1309,37 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
template<class AE>
|
||||
BOOST_UBLAS_INLINE
|
||||
hermitian_adaptor &operator = (const matrix_expression<AE> &ae) {
|
||||
matrix_assign (scalar_assign<value_type, value_type> (), *this, matrix<value_type> (ae));
|
||||
matrix_assign (scalar_assign<value_type, value_type> (), *this, matrix<value_type> (ae), functor_type ());
|
||||
return *this;
|
||||
}
|
||||
template<class AE>
|
||||
BOOST_UBLAS_INLINE
|
||||
hermitian_adaptor &assign (const matrix_expression<AE> &ae) {
|
||||
matrix_assign (scalar_assign<value_type, BOOST_UBLAS_TYPENAME AE::value_type> (), *this, ae);
|
||||
matrix_assign (scalar_assign<value_type, BOOST_UBLAS_TYPENAME AE::value_type> (), *this, ae, functor_type ());
|
||||
return *this;
|
||||
}
|
||||
template<class AE>
|
||||
BOOST_UBLAS_INLINE
|
||||
hermitian_adaptor& operator += (const matrix_expression<AE> &ae) {
|
||||
matrix_assign (scalar_assign<value_type, value_type> (), *this, matrix<value_type> (*this + ae));
|
||||
matrix_assign (scalar_assign<value_type, value_type> (), *this, matrix<value_type> (*this + ae), functor_type ());
|
||||
return *this;
|
||||
}
|
||||
template<class AE>
|
||||
BOOST_UBLAS_INLINE
|
||||
hermitian_adaptor &plus_assign (const matrix_expression<AE> &ae) {
|
||||
matrix_assign (scalar_plus_assign<value_type, BOOST_UBLAS_TYPENAME AE::value_type> (), *this, ae);
|
||||
matrix_assign (scalar_plus_assign<value_type, BOOST_UBLAS_TYPENAME AE::value_type> (), *this, ae, functor_type ());
|
||||
return *this;
|
||||
}
|
||||
template<class AE>
|
||||
BOOST_UBLAS_INLINE
|
||||
hermitian_adaptor& operator -= (const matrix_expression<AE> &ae) {
|
||||
matrix_assign (scalar_assign<value_type, value_type> (), *this, matrix<value_type> (*this - ae));
|
||||
matrix_assign (scalar_assign<value_type, value_type> (), *this, matrix<value_type> (*this - ae), functor_type ());
|
||||
return *this;
|
||||
}
|
||||
template<class AE>
|
||||
BOOST_UBLAS_INLINE
|
||||
hermitian_adaptor &minus_assign (const matrix_expression<AE> &ae) {
|
||||
matrix_assign (scalar_minus_assign<value_type, BOOST_UBLAS_TYPENAME AE::value_type> (), *this, ae);
|
||||
matrix_assign (scalar_minus_assign<value_type, BOOST_UBLAS_TYPENAME AE::value_type> (), *this, ae, functor_type ());
|
||||
return *this;
|
||||
}
|
||||
template<class AT>
|
||||
@@ -1369,7 +1369,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
// Too unusual semantic.
|
||||
// BOOST_UBLAS_CHECK (this != &m, external_logic ());
|
||||
if (this != &m)
|
||||
matrix_swap (scalar_swap<value_type, value_type> (), *this, m);
|
||||
matrix_swap (scalar_swap<value_type, value_type> (), *this, m, functor_type ());
|
||||
}
|
||||
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
BOOST_UBLAS_INLINE
|
||||
|
||||
@@ -1961,26 +1961,34 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
// Element lookup
|
||||
BOOST_UBLAS_INLINE
|
||||
const_iterator1 find_first1 (int rank, size_type i, size_type j) const {
|
||||
if (rank == 1)
|
||||
if (rank == 1) {
|
||||
i = std::max (i, j);
|
||||
i = std::min (i, j + 1);
|
||||
}
|
||||
return const_iterator1 (*this, i, j);
|
||||
}
|
||||
BOOST_UBLAS_INLINE
|
||||
const_iterator1 find_last1 (int rank, size_type i, size_type j) const {
|
||||
if (rank == 1)
|
||||
if (rank == 1) {
|
||||
i = std::max (i, j);
|
||||
i = std::min (i, j + 1);
|
||||
}
|
||||
return const_iterator1 (*this, i, j);
|
||||
}
|
||||
BOOST_UBLAS_INLINE
|
||||
const_iterator2 find_first2 (int rank, size_type i, size_type j) const {
|
||||
if (rank == 1)
|
||||
if (rank == 1) {
|
||||
j = std::max (j, i);
|
||||
j = std::min (j, i + 1);
|
||||
}
|
||||
return const_iterator2 (*this, i, j);
|
||||
}
|
||||
BOOST_UBLAS_INLINE
|
||||
const_iterator2 find_last2 (int rank, size_type i, size_type j) const {
|
||||
if (rank == 1)
|
||||
if (rank == 1) {
|
||||
j = std::max (j, i);
|
||||
j = std::min (j, i + 1);
|
||||
}
|
||||
return const_iterator2 (*this, i, j);
|
||||
}
|
||||
|
||||
@@ -2405,25 +2413,25 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
BOOST_UBLAS_INLINE
|
||||
const_iterator1 find_first1 (int rank, size_type i, size_type j) const {
|
||||
if (rank == 1)
|
||||
i = std::max (i, size_type (0));
|
||||
i = j;
|
||||
return const_iterator1 (*this, i, j);
|
||||
}
|
||||
BOOST_UBLAS_INLINE
|
||||
const_iterator1 find_last1 (int rank, size_type i, size_type j) const {
|
||||
if (rank == 1)
|
||||
i = std::min (i, size_type (0));
|
||||
i = j;
|
||||
return const_iterator1 (*this, i, j);
|
||||
}
|
||||
BOOST_UBLAS_INLINE
|
||||
const_iterator2 find_first2 (int rank, size_type i, size_type j) const {
|
||||
if (rank == 1)
|
||||
j = std::max (j, size_type (0));
|
||||
j = i;
|
||||
return const_iterator2 (*this, i, j);
|
||||
}
|
||||
BOOST_UBLAS_INLINE
|
||||
const_iterator2 find_last2 (int rank, size_type i, size_type j) const {
|
||||
if (rank == 1)
|
||||
j = std::min (j, size_type (0));
|
||||
j = i;
|
||||
return const_iterator2 (*this, i, j);
|
||||
}
|
||||
|
||||
|
||||
@@ -449,7 +449,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
template<class F, class M, class E, class C>
|
||||
// This function seems to be big. So we do not let the compiler inline it.
|
||||
// BOOST_UBLAS_INLINE
|
||||
void matrix_assign (const F &f, M &m, const matrix_expression<E> &e, dense_proxy_tag, C c) {
|
||||
void matrix_assign (const F &f, M &m, const matrix_expression<E> &e, full, dense_proxy_tag, C c) {
|
||||
typedef F functor_type;
|
||||
typedef C orientation_category;
|
||||
#ifdef BOOST_UBLAS_USE_INDEXING
|
||||
@@ -468,19 +468,20 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
#endif
|
||||
}
|
||||
// Packed (proxy) row major case
|
||||
template<class F, class M, class E>
|
||||
template<class F1, class M, class E, class F2>
|
||||
// This function seems to be big. So we do not let the compiler inline it.
|
||||
// BOOST_UBLAS_INLINE
|
||||
void matrix_assign (const F &f, M &m, const matrix_expression<E> &e, packed_proxy_tag, row_major_tag) {
|
||||
void matrix_assign (const F1 &f1, M &m, const matrix_expression<E> &e, const F2 &f2, packed_proxy_tag, row_major_tag) {
|
||||
BOOST_UBLAS_CHECK (m.size1 () == e ().size1 (), bad_size ());
|
||||
BOOST_UBLAS_CHECK (m.size2 () == e ().size2 (), bad_size ());
|
||||
typedef F functor_type;
|
||||
typedef F1 functor1_type;
|
||||
typedef F2 functor2_type;
|
||||
typedef typename M::difference_type difference_type;
|
||||
typedef typename M::value_type value_type;
|
||||
#ifdef BOOST_UBLAS_TYPE_CHECK_TOO_STRONG
|
||||
#ifdef BOOST_UBLAS_TYPE_CHECK
|
||||
matrix<value_type, row_major> cm (m.size1 (), m.size2 ());
|
||||
indexing_matrix_assign (scalar_assign<value_type, value_type> (), cm, m, row_major_tag ());
|
||||
indexing_matrix_assign (functor_type (), cm, e, row_major_tag ());
|
||||
indexing_matrix_assign (functor1_type (), cm, e, row_major_tag ());
|
||||
#endif
|
||||
typename M::iterator1 it1 (m.begin1 ());
|
||||
typename M::iterator1 it1_end (m.end1 ());
|
||||
@@ -506,7 +507,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
typename M::iterator2 it2_end (it1.end ());
|
||||
difference_type size2 (it2_end - it2);
|
||||
while (-- size2 >= 0)
|
||||
functor_type () (*it2, value_type ()), ++ it2;
|
||||
functor1_type () (*it2, value_type ()), ++ it2;
|
||||
++ it1;
|
||||
}
|
||||
diff1 += size1;
|
||||
@@ -535,7 +536,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
if (size2 > 0) {
|
||||
it2_size -= size2;
|
||||
while (-- size2 >= 0)
|
||||
functor_type () (*it2, value_type ()), ++ it2;
|
||||
functor1_type () (*it2, value_type ()), ++ it2;
|
||||
diff2 += size2;
|
||||
}
|
||||
}
|
||||
@@ -543,10 +544,10 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
it2_size -= size2;
|
||||
it2e_size -= size2;
|
||||
while (-- size2 >= 0)
|
||||
functor_type () (*it2, *it2e), ++ it2, ++ it2e;
|
||||
functor1_type () (*it2, *it2e), ++ it2, ++ it2e;
|
||||
size2 = it2_size;
|
||||
while (-- size2 >= 0)
|
||||
functor_type () (*it2, value_type ()), ++ it2;
|
||||
functor1_type () (*it2, value_type ()), ++ it2;
|
||||
++ it1, ++ it1e;
|
||||
}
|
||||
size1 = it1_size;
|
||||
@@ -555,28 +556,29 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
typename M::iterator2 it2_end (it1.end ());
|
||||
difference_type size2 (it2_end - it2);
|
||||
while (-- size2 >= 0)
|
||||
functor_type () (*it2, value_type ()), ++ it2;
|
||||
functor1_type () (*it2, value_type ()), ++ it2;
|
||||
++ it1;
|
||||
}
|
||||
#ifdef BOOST_UBLAS_TYPE_CHECK_TOO_STRONG
|
||||
#ifdef BOOST_UBLAS_TYPE_CHECK
|
||||
if (! disable_type_check)
|
||||
BOOST_UBLAS_CHECK (equals (m, cm), external_logic ());
|
||||
#endif
|
||||
}
|
||||
// Packed (proxy) column major case
|
||||
template<class F, class M, class E>
|
||||
template<class F1, class M, class E, class F2>
|
||||
// This function seems to be big. So we do not let the compiler inline it.
|
||||
// BOOST_UBLAS_INLINE
|
||||
void matrix_assign (const F &f, M &m, const matrix_expression<E> &e, packed_proxy_tag, column_major_tag) {
|
||||
void matrix_assign (const F1 &f1, M &m, const matrix_expression<E> &e, const F2 &f2, packed_proxy_tag, column_major_tag) {
|
||||
BOOST_UBLAS_CHECK (m.size2 () == e ().size2 (), bad_size ());
|
||||
BOOST_UBLAS_CHECK (m.size1 () == e ().size1 (), bad_size ());
|
||||
typedef F functor_type;
|
||||
typedef F1 functor1_type;
|
||||
typedef F2 functor2_type;
|
||||
typedef typename M::difference_type difference_type;
|
||||
typedef typename M::value_type value_type;
|
||||
#ifdef BOOST_UBLAS_TYPE_CHECK_TOO_STRONG
|
||||
#ifdef BOOST_UBLAS_TYPE_CHECK
|
||||
matrix<value_type, column_major> cm (m.size1 (), m.size2 ());
|
||||
indexing_matrix_assign (scalar_assign<value_type, value_type> (), cm, m, column_major_tag ());
|
||||
indexing_matrix_assign (functor_type (), cm, e, column_major_tag ());
|
||||
indexing_matrix_assign (functor1_type (), cm, e, column_major_tag ());
|
||||
#endif
|
||||
typename M::iterator2 it2 (m.begin2 ());
|
||||
typename M::iterator2 it2_end (m.end2 ());
|
||||
@@ -602,7 +604,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
typename M::iterator1 it1_end (it2.end ());
|
||||
difference_type size1 (it1_end - it1);
|
||||
while (-- size1 >= 0)
|
||||
functor_type () (*it1, value_type ()), ++ it1;
|
||||
functor1_type () (*it1, value_type ()), ++ it1;
|
||||
++ it2;
|
||||
}
|
||||
diff2 += size2;
|
||||
@@ -631,7 +633,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
if (size1 > 0) {
|
||||
it1_size -= size1;
|
||||
while (-- size1 >= 0)
|
||||
functor_type () (*it1, value_type ()), ++ it1;
|
||||
functor1_type () (*it1, value_type ()), ++ it1;
|
||||
diff1 += size1;
|
||||
}
|
||||
}
|
||||
@@ -639,10 +641,10 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
it1_size -= size1;
|
||||
it1e_size -= size1;
|
||||
while (-- size1 >= 0)
|
||||
functor_type () (*it1, *it1e), ++ it1, ++ it1e;
|
||||
functor1_type () (*it1, *it1e), ++ it1, ++ it1e;
|
||||
size1 = it1_size;
|
||||
while (-- size1 >= 0)
|
||||
functor_type () (*it1, value_type ()), ++ it1;
|
||||
functor1_type () (*it1, value_type ()), ++ it1;
|
||||
++ it2, ++ it2e;
|
||||
}
|
||||
size2 = it2_size;
|
||||
@@ -651,10 +653,10 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
typename M::iterator1 it1_end (it2.end ());
|
||||
difference_type size1 (it1_end - it1);
|
||||
while (-- size1 >= 0)
|
||||
functor_type () (*it1, value_type ()), ++ it1;
|
||||
functor1_type () (*it1, value_type ()), ++ it1;
|
||||
++ it2;
|
||||
}
|
||||
#ifdef BOOST_UBLAS_TYPE_CHECK_TOO_STRONG
|
||||
#ifdef BOOST_UBLAS_TYPE_CHECK
|
||||
if (! disable_type_check)
|
||||
BOOST_UBLAS_CHECK (equals (m, cm), external_logic ());
|
||||
#endif
|
||||
@@ -663,7 +665,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
template<class F, class M, class E>
|
||||
// This function seems to be big. So we do not let the compiler inline it.
|
||||
// BOOST_UBLAS_INLINE
|
||||
void matrix_assign (const F &f, M &m, const matrix_expression<E> &e, sparse_tag, row_major_tag) {
|
||||
void matrix_assign (const F &f, M &m, const matrix_expression<E> &e, full, sparse_tag, row_major_tag) {
|
||||
BOOST_UBLAS_CHECK (m.size1 () == e ().size1 (), bad_size ());
|
||||
BOOST_UBLAS_CHECK (m.size2 () == e ().size2 (), bad_size ());
|
||||
typedef F functor_type;
|
||||
@@ -696,7 +698,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
template<class F, class M, class E>
|
||||
// This function seems to be big. So we do not let the compiler inline it.
|
||||
// BOOST_UBLAS_INLINE
|
||||
void matrix_assign (const F &f, M &m, const matrix_expression<E> &e, sparse_tag, column_major_tag) {
|
||||
void matrix_assign (const F &f, M &m, const matrix_expression<E> &e, full, sparse_tag, column_major_tag) {
|
||||
BOOST_UBLAS_CHECK (m.size1 () == e ().size1 (), bad_size ());
|
||||
BOOST_UBLAS_CHECK (m.size2 () == e ().size2 (), bad_size ());
|
||||
typedef F functor_type;
|
||||
@@ -726,19 +728,20 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
#endif
|
||||
}
|
||||
// Sparse proxy row major case
|
||||
template<class F, class M, class E>
|
||||
template<class F1, class M, class E, class F2>
|
||||
// This function seems to be big. So we do not let the compiler inline it.
|
||||
// BOOST_UBLAS_INLINE
|
||||
void matrix_assign (const F &f, M &m, const matrix_expression<E> &e, sparse_proxy_tag, row_major_tag) {
|
||||
void matrix_assign (const F1 &f1, M &m, const matrix_expression<E> &e, const F2 &f2, sparse_proxy_tag, row_major_tag) {
|
||||
BOOST_UBLAS_CHECK (m.size1 () == e ().size1 (), bad_size ());
|
||||
BOOST_UBLAS_CHECK (m.size2 () == e ().size2 (), bad_size ());
|
||||
typedef F functor_type;
|
||||
typedef F1 functor1_type;
|
||||
typedef F2 functor2_type;
|
||||
typedef typename M::size_type size_type;
|
||||
typedef typename M::value_type value_type;
|
||||
#ifdef BOOST_UBLAS_TYPE_CHECK
|
||||
matrix<value_type, row_major> cm (m.size1 (), m.size2 ());
|
||||
indexing_matrix_assign (scalar_assign<value_type, value_type> (), cm, m, row_major_tag ());
|
||||
indexing_matrix_assign (functor_type (), cm, e, row_major_tag ());
|
||||
indexing_matrix_assign (functor1_type (), cm, e, row_major_tag ());
|
||||
#endif
|
||||
typename M::iterator1 it1 (m.begin1 ());
|
||||
typename M::iterator1 it1_end (m.end1 ());
|
||||
@@ -754,20 +757,26 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
while (it2 != it2_end && it2e != it2e_end) {
|
||||
int compare = it2.index2 () - it2e.index2 ();
|
||||
if (compare == 0) {
|
||||
functor_type () (*it2, *it2e);
|
||||
functor1_type () (*it2, *it2e);
|
||||
++ it2, ++ it2e;
|
||||
} else if (compare < 0) {
|
||||
functor_type () (*it2, value_type ());
|
||||
functor1_type () (*it2, value_type ());
|
||||
++ it2;
|
||||
} else if (compare > 0) {
|
||||
#ifdef BOOST_UBLAS_NON_CONFORMANT_PROXIES
|
||||
// Sparse proxies don't need to be conformant.
|
||||
// Thanks to Michael Stevens for suggesting this.
|
||||
size_type index1 (it2e.index1 ()), index2 (it2e.index2 ());
|
||||
functor_type () (m (index1, index2), e () (index1, index2));
|
||||
restart (m, index1, index2, it1, it1_end, it2, it2_end, row_major_tag ());
|
||||
// The proxies could reference the same container.
|
||||
restart (e, index1, index2, it1e, it1e_end, it2e, it2e_end, row_major_tag ());
|
||||
if (functor2_type::other (index1, index2)) {
|
||||
functor1_type () (m (index1, index2), e () (index1, index2));
|
||||
restart (m, index1, index2, it1, it1_end, it2, it2_end, row_major_tag ());
|
||||
// The proxies could reference the same container.
|
||||
restart (e, index1, index2, it1e, it1e_end, it2e, it2e_end, row_major_tag ());
|
||||
} else {
|
||||
++ it2e;
|
||||
}
|
||||
#else
|
||||
++ it2e;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -776,14 +785,18 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
// Sparse proxies don't need to be conformant.
|
||||
// Thanks to Michael Stevens for suggesting this.
|
||||
size_type index1 (it2e.index1 ()), index2 (it2e.index2 ());
|
||||
functor_type () (m (index1, index2), e () (index1, index2));
|
||||
// The proxies could reference the same container.
|
||||
restart (e, index1, index2, it1e, it1e_end, it2e, it2e_end, row_major_tag ());
|
||||
restart (m, index1, index2, it1, it1_end, it2, it2_end, row_major_tag ());
|
||||
if (functor2_type::other (index1, index2)) {
|
||||
functor1_type () (m (index1, index2), e () (index1, index2));
|
||||
// The proxies could reference the same container.
|
||||
restart (e, index1, index2, it1e, it1e_end, it2e, it2e_end, row_major_tag ());
|
||||
restart (m, index1, index2, it1, it1_end, it2, it2_end, row_major_tag ());
|
||||
} else {
|
||||
++ it2e;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
while (it2 != it2_end) {
|
||||
functor_type () (*it2, value_type ());
|
||||
functor1_type () (*it2, value_type ());
|
||||
++ it2;
|
||||
}
|
||||
++ it1, ++ it1e;
|
||||
@@ -791,7 +804,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
typename M::iterator2 it2 (it1.begin ());
|
||||
typename M::iterator2 it2_end (it1.end ());
|
||||
while (it2 != it2_end) {
|
||||
functor_type () (*it2, value_type ());
|
||||
functor1_type () (*it2, value_type ());
|
||||
++ it2;
|
||||
}
|
||||
++ it1;
|
||||
@@ -805,10 +818,14 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
// Sparse proxies don't need to be conformant.
|
||||
// Thanks to Michael Stevens for suggesting this.
|
||||
size_type index1 (it2e.index1 ()), index2 (it2e.index2 ());
|
||||
functor_type () (m (index1, index2), e () (index1, index2));
|
||||
// The proxies could reference the same container.
|
||||
restart (e, index1, index2, it1e, it1e_end, it2e, it2e_end, row_major_tag ());
|
||||
restart (m, index1, index2, it1, it1_end, it2, it2_end, row_major_tag ());
|
||||
if (functor2_type::other (index1, index2)) {
|
||||
functor1_type () (m (index1, index2), e () (index1, index2));
|
||||
// The proxies could reference the same container.
|
||||
restart (e, index1, index2, it1e, it1e_end, it2e, it2e_end, row_major_tag ());
|
||||
restart (m, index1, index2, it1, it1_end, it2, it2_end, row_major_tag ());
|
||||
} else {
|
||||
++ it2e;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
++ it1e;
|
||||
@@ -824,10 +841,14 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
// Sparse proxies don't need to be conformant.
|
||||
// Thanks to Michael Stevens for suggesting this.
|
||||
size_type index1 (it2e.index1 ()), index2 (it2e.index2 ());
|
||||
functor_type () (m (index1, index2), e () (index1, index2));
|
||||
// The proxies could reference the same container.
|
||||
restart (e, index1, index2, it1e, it1e_end, it2e, it2e_end, row_major_tag ());
|
||||
restart (m, index1, index2, it1, it1_end, it2, it2_end, row_major_tag ());
|
||||
if (functor2_type::other (index1, index2)) {
|
||||
functor1_type () (m (index1, index2), e () (index1, index2));
|
||||
// The proxies could reference the same container.
|
||||
restart (e, index1, index2, it1e, it1e_end, it2e, it2e_end, row_major_tag ());
|
||||
restart (m, index1, index2, it1, it1_end, it2, it2_end, row_major_tag ());
|
||||
} else {
|
||||
++ it2e;
|
||||
}
|
||||
}
|
||||
++ it1e;
|
||||
}
|
||||
@@ -836,7 +857,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
typename M::iterator2 it2 (it1.begin ());
|
||||
typename M::iterator2 it2_end (it1.end ());
|
||||
while (it2 != it2_end) {
|
||||
functor_type () (*it2, value_type ());
|
||||
functor1_type () (*it2, value_type ());
|
||||
++ it2;
|
||||
}
|
||||
++ it1;
|
||||
@@ -847,19 +868,20 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
#endif
|
||||
}
|
||||
// Sparse proxy column major case
|
||||
template<class F, class M, class E>
|
||||
template<class F1, class M, class E, class F2>
|
||||
// This function seems to be big. So we do not let the compiler inline it.
|
||||
// BOOST_UBLAS_INLINE
|
||||
void matrix_assign (const F &f, M &m, const matrix_expression<E> &e, sparse_proxy_tag, column_major_tag) {
|
||||
void matrix_assign (const F1 &f1, M &m, const matrix_expression<E> &e, const F2 &f2, sparse_proxy_tag, column_major_tag) {
|
||||
BOOST_UBLAS_CHECK (m.size1 () == e ().size1 (), bad_size ());
|
||||
BOOST_UBLAS_CHECK (m.size2 () == e ().size2 (), bad_size ());
|
||||
typedef F functor_type;
|
||||
typedef F1 functor1_type;
|
||||
typedef F2 functor2_type;
|
||||
typedef typename M::size_type size_type;
|
||||
typedef typename M::value_type value_type;
|
||||
#ifdef BOOST_UBLAS_TYPE_CHECK
|
||||
matrix<value_type, column_major> cm (m.size1 (), m.size2 ());
|
||||
indexing_matrix_assign (scalar_assign<value_type, value_type> (), cm, m, column_major_tag ());
|
||||
indexing_matrix_assign (functor_type (), cm, e, column_major_tag ());
|
||||
indexing_matrix_assign (functor1_type (), cm, e, column_major_tag ());
|
||||
#endif
|
||||
typename M::iterator2 it2 (m.begin2 ());
|
||||
typename M::iterator2 it2_end (m.end2 ());
|
||||
@@ -875,20 +897,26 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
while (it1 != it1_end && it1e != it1e_end) {
|
||||
int compare = it1.index1 () - it1e.index1 ();
|
||||
if (compare == 0) {
|
||||
functor_type () (*it1, *it1e);
|
||||
functor1_type () (*it1, *it1e);
|
||||
++ it1, ++ it1e;
|
||||
} else if (compare < 0) {
|
||||
functor_type () (*it1, value_type ());
|
||||
functor1_type () (*it1, value_type ());
|
||||
++ it1;
|
||||
} else if (compare > 0) {
|
||||
#ifdef BOOST_UBLAS_NON_CONFORMANT_PROXIES
|
||||
// Sparse proxies don't need to be conformant.
|
||||
// Thanks to Michael Stevens for suggesting this.
|
||||
size_type index1 (it1e.index1 ()), index2 (it1e.index2 ());
|
||||
functor_type () (m (index1, index2), e () (index1, index2));
|
||||
restart (m, index1, index2, it2, it2_end, it1, it1_end, column_major_tag ());
|
||||
// The proxies could reference the same container.
|
||||
restart (e, index1, index2, it2e, it2e_end, it1e, it1e_end, column_major_tag ());
|
||||
if (functor2_type::other (index1, index2)) {
|
||||
functor1_type () (m (index1, index2), e () (index1, index2));
|
||||
restart (m, index1, index2, it2, it2_end, it1, it1_end, column_major_tag ());
|
||||
// The proxies could reference the same container.
|
||||
restart (e, index1, index2, it2e, it2e_end, it1e, it1e_end, column_major_tag ());
|
||||
} else {
|
||||
++ it1e;
|
||||
}
|
||||
#else
|
||||
++ it1e;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -897,14 +925,18 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
// Sparse proxies don't need to be conformant.
|
||||
// Thanks to Michael Stevens for suggesting this.
|
||||
size_type index1 (it1e.index1 ()), index2 (it1e.index2 ());
|
||||
functor_type () (m (index1, index2), e () (index1, index2));
|
||||
// The proxies could reference the same container.
|
||||
restart (e, index1, index2, it2e, it2e_end, it1e, it1e_end, column_major_tag ());
|
||||
restart (m, index1, index2, it2, it2_end, it1, it1_end, column_major_tag ());
|
||||
if (functor2_type::other (index1, index2)) {
|
||||
functor1_type () (m (index1, index2), e () (index1, index2));
|
||||
// The proxies could reference the same container.
|
||||
restart (e, index1, index2, it2e, it2e_end, it1e, it1e_end, column_major_tag ());
|
||||
restart (m, index1, index2, it2, it2_end, it1, it1_end, column_major_tag ());
|
||||
} else {
|
||||
++ it1e;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
while (it1 != it1_end) {
|
||||
functor_type () (*it1, value_type ());
|
||||
functor1_type () (*it1, value_type ());
|
||||
++ it1;
|
||||
}
|
||||
++ it2, ++ it2e;
|
||||
@@ -912,7 +944,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
typename M::iterator1 it1 (it2.begin ());
|
||||
typename M::iterator1 it1_end (it2.end ());
|
||||
while (it1 != it1_end) {
|
||||
functor_type () (*it1, value_type ());
|
||||
functor1_type () (*it1, value_type ());
|
||||
++ it1;
|
||||
}
|
||||
++ it2;
|
||||
@@ -926,10 +958,14 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
// Sparse proxies don't need to be conformant.
|
||||
// Thanks to Michael Stevens for suggesting this.
|
||||
size_type index1 (it1e.index1 ()), index2 (it1e.index2 ());
|
||||
functor_type () (m (index1, index2), e () (index1, index2));
|
||||
// The proxies could reference the same container.
|
||||
restart (e, index1, index2, it2e, it2e_end, it1e, it1e_end, column_major_tag ());
|
||||
restart (m, index1, index2, it2, it2_end, it1, it1_end, column_major_tag ());
|
||||
if (functor2_type::other (index1, index2)) {
|
||||
functor1_type () (m (index1, index2), e () (index1, index2));
|
||||
// The proxies could reference the same container.
|
||||
restart (e, index1, index2, it2e, it2e_end, it1e, it1e_end, column_major_tag ());
|
||||
restart (m, index1, index2, it2, it2_end, it1, it1_end, column_major_tag ());
|
||||
} else {
|
||||
++ it1e;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
++ it2e;
|
||||
@@ -945,10 +981,14 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
// Sparse proxies don't need to be conformant.
|
||||
// Thanks to Michael Stevens for suggesting this.
|
||||
size_type index1 (it1e.index1 ()), index2 (it1e.index2 ());
|
||||
functor_type () (m (index1, index2), e () (index1, index2));
|
||||
// The proxies could reference the same container.
|
||||
restart (e, index1, index2, it2e, it2e_end, it1e, it1e_end, column_major_tag ());
|
||||
restart (m, index1, index2, it2, it2_end, it1, it1_end, column_major_tag ());
|
||||
if (functor2_type::other (index1, index2)) {
|
||||
functor1_type () (m (index1, index2), e () (index1, index2));
|
||||
// The proxies could reference the same container.
|
||||
restart (e, index1, index2, it2e, it2e_end, it1e, it1e_end, column_major_tag ());
|
||||
restart (m, index1, index2, it2, it2_end, it1, it1_end, column_major_tag ());
|
||||
} else {
|
||||
++ it1e;
|
||||
}
|
||||
}
|
||||
++ it2e;
|
||||
}
|
||||
@@ -957,7 +997,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
typename M::iterator1 it1 (it2.begin ());
|
||||
typename M::iterator1 it1_end (it2.end ());
|
||||
while (it1 != it1_end) {
|
||||
functor_type () (*it1, value_type ());
|
||||
functor1_type () (*it1, value_type ());
|
||||
++ it1;
|
||||
}
|
||||
++ it2;
|
||||
@@ -980,7 +1020,21 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
// FIXME: can't we improve the dispatch here?
|
||||
// typedef typename E::orientation_category orientation_category;
|
||||
typedef typename M::orientation_category orientation_category;
|
||||
matrix_assign (functor_type (), m, e, storage_category (), orientation_category ());
|
||||
matrix_assign (functor_type (), m, e, full (), storage_category (), orientation_category ());
|
||||
}
|
||||
template<class F1, class M, class E, class F2>
|
||||
BOOST_UBLAS_INLINE
|
||||
void matrix_assign (const F1 &f1, M &m, const matrix_expression<E> &e, const F2 &f2) {
|
||||
typedef F1 functor1_type;
|
||||
typedef F2 functor2_type;
|
||||
typedef typename matrix_assign_traits<BOOST_UBLAS_TYPENAME M::storage_category,
|
||||
BOOST_UBLAS_TYPENAME F1::assign_category,
|
||||
BOOST_UBLAS_TYPENAME E::const_iterator1::iterator_category,
|
||||
BOOST_UBLAS_TYPENAME E::const_iterator2::iterator_category>::storage_category storage_category;
|
||||
// FIXME: can't we improve the dispatch here?
|
||||
// typedef typename E::orientation_category orientation_category;
|
||||
typedef typename M::orientation_category orientation_category;
|
||||
matrix_assign (functor1_type (), m, e, functor2_type (), storage_category (), orientation_category ());
|
||||
}
|
||||
|
||||
template<class LS, class RI1, class RI2>
|
||||
@@ -1002,7 +1056,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
template<class F, class M, class E>
|
||||
// This function seems to be big. So we do not let the compiler inline it.
|
||||
// BOOST_UBLAS_INLINE
|
||||
void matrix_swap (const F &f, M &m, matrix_expression<E> &e, dense_proxy_tag, row_major_tag) {
|
||||
void matrix_swap (const F &f, M &m, matrix_expression<E> &e, full, dense_proxy_tag, row_major_tag) {
|
||||
typedef F functor_type;
|
||||
typedef typename M::size_type size_type;
|
||||
typedef typename M::difference_type difference_type;
|
||||
@@ -1022,7 +1076,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
template<class F, class M, class E>
|
||||
// This function seems to be big. So we do not let the compiler inline it.
|
||||
// BOOST_UBLAS_INLINE
|
||||
void matrix_swap (const F &f, M &m, matrix_expression<E> &e, dense_proxy_tag, column_major_tag) {
|
||||
void matrix_swap (const F &f, M &m, matrix_expression<E> &e, full, dense_proxy_tag, column_major_tag) {
|
||||
typedef F functor_type;
|
||||
typedef typename M::size_type size_type;
|
||||
typedef typename M::difference_type difference_type;
|
||||
@@ -1039,11 +1093,12 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
}
|
||||
}
|
||||
// Packed (proxy) row major case
|
||||
template<class F, class M, class E>
|
||||
template<class F1, class M, class E, class F2>
|
||||
// This function seems to be big. So we do not let the compiler inline it.
|
||||
// BOOST_UBLAS_INLINE
|
||||
void matrix_swap (const F &f, M &m, matrix_expression<E> &e, packed_proxy_tag, row_major_tag) {
|
||||
typedef F functor_type;
|
||||
void matrix_swap (const F1 &f1, M &m, matrix_expression<E> &e, const F2 &f2, packed_proxy_tag, row_major_tag) {
|
||||
typedef F1 functor1_type;
|
||||
typedef F2 functor2_type;
|
||||
typedef typename M::size_type size_type;
|
||||
typedef typename M::difference_type difference_type;
|
||||
typename M::iterator1 it1 (m.begin1 ());
|
||||
@@ -1054,16 +1109,17 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
typename E::iterator2 it2e (it1e.begin ());
|
||||
difference_type size2 (BOOST_UBLAS_SAME (it1.end () - it2, it1e.end () - it2e));
|
||||
while (-- size2 >= 0)
|
||||
functor_type () (*it2, *it2e), ++ it2, ++ it2e;
|
||||
functor1_type () (*it2, *it2e), ++ it2, ++ it2e;
|
||||
++ it1, ++ it1e;
|
||||
}
|
||||
}
|
||||
// Packed (proxy) column major case
|
||||
template<class F, class M, class E>
|
||||
template<class F1, class M, class E, class F2>
|
||||
// This function seems to be big. So we do not let the compiler inline it.
|
||||
// BOOST_UBLAS_INLINE
|
||||
void matrix_swap (const F &f, M &m, matrix_expression<E> &e, packed_proxy_tag, column_major_tag) {
|
||||
typedef F functor_type;
|
||||
void matrix_swap (const F1 &f1, M &m, matrix_expression<E> &e, const F2 &f2, packed_proxy_tag, column_major_tag) {
|
||||
typedef F1 functor1_type;
|
||||
typedef F2 functor2_type;
|
||||
typedef typename M::size_type size_type;
|
||||
typedef typename M::difference_type difference_type;
|
||||
typename M::iterator2 it2 (m.begin2 ());
|
||||
@@ -1074,18 +1130,19 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
typename E::iterator1 it1e (it2e.begin ());
|
||||
difference_type size1 (BOOST_UBLAS_SAME (it2.end () - it1, it2e.end () - it1e));
|
||||
while (-- size1 >= 0)
|
||||
functor_type () (*it1, *it1e), ++ it1, ++ it1e;
|
||||
functor1_type () (*it1, *it1e), ++ it1, ++ it1e;
|
||||
++ it2, ++ it2e;
|
||||
}
|
||||
}
|
||||
// Sparse (proxy) row major case
|
||||
template<class F, class M, class E>
|
||||
template<class F1, class M, class E, class F2>
|
||||
// This function seems to be big. So we do not let the compiler inline it.
|
||||
// BOOST_UBLAS_INLINE
|
||||
void matrix_swap (const F &f, M &m, matrix_expression<E> &e, sparse_proxy_tag, row_major_tag) {
|
||||
void matrix_swap (const F1 &f1, M &m, matrix_expression<E> &e, const F2 &f2, sparse_proxy_tag, row_major_tag) {
|
||||
BOOST_UBLAS_CHECK (m.size1 () == e ().size1 (), bad_size ());
|
||||
BOOST_UBLAS_CHECK (m.size2 () == e ().size2 (), bad_size ());
|
||||
typedef F functor_type;
|
||||
typedef F1 functor1_type;
|
||||
typedef F2 functor2_type;
|
||||
typedef typename M::size_type size_type;
|
||||
typedef typename M::value_type value_type;
|
||||
typename M::iterator1 it1 (m.begin1 ());
|
||||
@@ -1102,27 +1159,39 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
while (it2 != it2_end && it2e != it2e_end) {
|
||||
int compare = it2.index2 () - it2e.index2 ();
|
||||
if (compare == 0) {
|
||||
functor_type () (*it2, *it2e);
|
||||
functor1_type () (*it2, *it2e);
|
||||
++ it2, ++ it2e;
|
||||
} else if (compare < 0) {
|
||||
#ifdef BOOST_UBLAS_NON_CONFORMANT_PROXIES
|
||||
// Sparse proxies don't need to be conformant.
|
||||
// Thanks to Michael Stevens for suggesting this.
|
||||
size_type index1 (it2.index1 ()), index2 (it2.index2 ());
|
||||
functor_type () (m (index1, index2), e () (index1, index2));
|
||||
restart (e, index1, index2, it1e, it1e_end, it2e, it2e_end, row_major_tag ());
|
||||
// The proxies could reference the same container.
|
||||
restart (m, index1, index2, it1, it1_end, it2, it2_end, row_major_tag ());
|
||||
if (functor2_type::other (index1, index2)) {
|
||||
functor1_type () (m (index1, index2), e () (index1, index2));
|
||||
restart (e, index1, index2, it1e, it1e_end, it2e, it2e_end, row_major_tag ());
|
||||
// The proxies could reference the same container.
|
||||
restart (m, index1, index2, it1, it1_end, it2, it2_end, row_major_tag ());
|
||||
} else {
|
||||
++ it2;
|
||||
}
|
||||
#else
|
||||
++ it2;
|
||||
#endif
|
||||
} else if (compare > 0) {
|
||||
#ifdef BOOST_UBLAS_NON_CONFORMANT_PROXIES
|
||||
// Sparse proxies don't need to be conformant.
|
||||
// Thanks to Michael Stevens for suggesting this.
|
||||
size_type index1 (it2e.index1 ()), index2 (it2e.index2 ());
|
||||
functor_type () (m (index1, index2), e () (index1, index2));
|
||||
restart (m, index1, index2, it1, it1_end, it2, it2_end, row_major_tag ());
|
||||
// The proxies could reference the same container.
|
||||
restart (e, index1, index2, it1e, it1e_end, it2e, it2e_end, row_major_tag ());
|
||||
if (functor2_type::other (index1, index2)) {
|
||||
functor1_type () (m (index1, index2), e () (index1, index2));
|
||||
restart (m, index1, index2, it1, it1_end, it2, it2_end, row_major_tag ());
|
||||
// The proxies could reference the same container.
|
||||
restart (e, index1, index2, it1e, it1e_end, it2e, it2e_end, row_major_tag ());
|
||||
} else {
|
||||
++ it2e;
|
||||
}
|
||||
#else
|
||||
++ it2e;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -1131,19 +1200,27 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
// Sparse proxies don't need to be conformant.
|
||||
// Thanks to Michael Stevens for suggesting this.
|
||||
size_type index1 (it2e.index1 ()), index2 (it2e.index2 ());
|
||||
functor_type () (m (index1, index2), e () (index1, index2));
|
||||
// The proxies could reference the same container.
|
||||
restart (e, index1, index2, it1e, it1e_end, it2e, it2e_end, row_major_tag ());
|
||||
restart (m, index1, index2, it1, it1_end, it2, it2_end, row_major_tag ());
|
||||
if (functor2_type::other (index1, index2)) {
|
||||
functor1_type () (m (index1, index2), e () (index1, index2));
|
||||
// The proxies could reference the same container.
|
||||
restart (e, index1, index2, it1e, it1e_end, it2e, it2e_end, row_major_tag ());
|
||||
restart (m, index1, index2, it1, it1_end, it2, it2_end, row_major_tag ());
|
||||
} else {
|
||||
++ it2e;
|
||||
}
|
||||
}
|
||||
while (it2 != it2_end) {
|
||||
// Sparse proxies don't need to be conformant.
|
||||
// Thanks to Michael Stevens for suggesting this.
|
||||
size_type index1 (it2.index1 ()), index2 (it2.index2 ());
|
||||
functor_type () (m (index1, index2), e () (index1, index2));
|
||||
// The proxies could reference the same container.
|
||||
restart (m, index1, index2, it1, it1_end, it2, it2_end, row_major_tag ());
|
||||
restart (e, index1, index2, it1e, it1e_end, it2e, it2e_end, row_major_tag ());
|
||||
if (functor2_type::other (index1, index2)) {
|
||||
functor1_type () (m (index1, index2), e () (index1, index2));
|
||||
// The proxies could reference the same container.
|
||||
restart (m, index1, index2, it1, it1_end, it2, it2_end, row_major_tag ());
|
||||
restart (e, index1, index2, it1e, it1e_end, it2e, it2e_end, row_major_tag ());
|
||||
} else {
|
||||
++ it2;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
++ it1, ++ it1e;
|
||||
@@ -1157,10 +1234,14 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
// Sparse proxies don't need to be conformant.
|
||||
// Thanks to Michael Stevens for suggesting this.
|
||||
size_type index1 (it2.index1 ()), index2 (it2.index2 ());
|
||||
functor_type () (m (index1, index2), e () (index1, index2));
|
||||
// The proxies could reference the same container.
|
||||
restart (m, index1, index2, it1, it1_end, it2, it2_end, row_major_tag ());
|
||||
restart (e, index1, index2, it1e, it1e_end, it2e, it2e_end, row_major_tag ());
|
||||
if (functor2_type::other (index1, index2)) {
|
||||
functor1_type () (m (index1, index2), e () (index1, index2));
|
||||
// The proxies could reference the same container.
|
||||
restart (m, index1, index2, it1, it1_end, it2, it2_end, row_major_tag ());
|
||||
restart (e, index1, index2, it1e, it1e_end, it2e, it2e_end, row_major_tag ());
|
||||
} else {
|
||||
++ it2;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
++ it1;
|
||||
@@ -1174,10 +1255,14 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
// Sparse proxies don't need to be conformant.
|
||||
// Thanks to Michael Stevens for suggesting this.
|
||||
size_type index1 (it2e.index1 ()), index2 (it2e.index2 ());
|
||||
functor_type () (m (index1, index2), e () (index1, index2));
|
||||
// The proxies could reference the same container.
|
||||
restart (e, index1, index2, it1e, it1e_end, it2e, it2e_end, row_major_tag ());
|
||||
restart (m, index1, index2, it1, it1_end, it2, it2_end, row_major_tag ());
|
||||
if (functor2_type::other (index1, index2)) {
|
||||
functor1_type () (m (index1, index2), e () (index1, index2));
|
||||
// The proxies could reference the same container.
|
||||
restart (e, index1, index2, it1e, it1e_end, it2e, it2e_end, row_major_tag ());
|
||||
restart (m, index1, index2, it1, it1_end, it2, it2_end, row_major_tag ());
|
||||
} else {
|
||||
++ it2e;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
++ it1e;
|
||||
@@ -1193,10 +1278,14 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
// Sparse proxies don't need to be conformant.
|
||||
// Thanks to Michael Stevens for suggesting this.
|
||||
size_type index1 (it2e.index1 ()), index2 (it2e.index2 ());
|
||||
functor_type () (m (index1, index2), e () (index1, index2));
|
||||
// The proxies could reference the same container.
|
||||
restart (e, index1, index2, it1e, it1e_end, it2e, it2e_end, row_major_tag ());
|
||||
restart (m, index1, index2, it1, it1_end, it2, it2_end, row_major_tag ());
|
||||
if (functor2_type::other (index1, index2)) {
|
||||
functor1_type () (m (index1, index2), e () (index1, index2));
|
||||
// The proxies could reference the same container.
|
||||
restart (e, index1, index2, it1e, it1e_end, it2e, it2e_end, row_major_tag ());
|
||||
restart (m, index1, index2, it1, it1_end, it2, it2_end, row_major_tag ());
|
||||
} else {
|
||||
++ it2e;
|
||||
}
|
||||
}
|
||||
++ it1e;
|
||||
}
|
||||
@@ -1209,23 +1298,28 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
// Sparse proxies don't need to be conformant.
|
||||
// Thanks to Michael Stevens for suggesting this.
|
||||
size_type index1 (it2.index1 ()), index2 (it2.index2 ());
|
||||
functor_type () (m (index1, index2), e () (index1, index2));
|
||||
// The proxies could reference the same container.
|
||||
restart (m, index1, index2, it1, it1_end, it2, it2_end, row_major_tag ());
|
||||
restart (e, index1, index2, it1e, it1e_end, it2e, it2e_end, row_major_tag ());
|
||||
if (functor2_type::other (index1, index2)) {
|
||||
functor1_type () (m (index1, index2), e () (index1, index2));
|
||||
// The proxies could reference the same container.
|
||||
restart (m, index1, index2, it1, it1_end, it2, it2_end, row_major_tag ());
|
||||
restart (e, index1, index2, it1e, it1e_end, it2e, it2e_end, row_major_tag ());
|
||||
} else {
|
||||
++ it2;
|
||||
}
|
||||
}
|
||||
++ it1;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
// Sparse (proxy) column major case
|
||||
template<class F, class M, class E>
|
||||
template<class F1, class M, class E, class F2>
|
||||
// This function seems to be big. So we do not let the compiler inline it.
|
||||
// BOOST_UBLAS_INLINE
|
||||
void matrix_swap (const F &f, M &m, matrix_expression<E> &e, sparse_proxy_tag, column_major_tag) {
|
||||
void matrix_swap (const F1 &f1, M &m, matrix_expression<E> &e, const F2 &f2, sparse_proxy_tag, column_major_tag) {
|
||||
BOOST_UBLAS_CHECK (m.size1 () == e ().size1 (), bad_size ());
|
||||
BOOST_UBLAS_CHECK (m.size2 () == e ().size2 (), bad_size ());
|
||||
typedef F functor_type;
|
||||
typedef F1 functor1_type;
|
||||
typedef F2 functor2_type;
|
||||
typedef typename M::size_type size_type;
|
||||
typedef typename M::value_type value_type;
|
||||
typename M::iterator2 it2 (m.begin2 ());
|
||||
@@ -1242,27 +1336,39 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
while (it1 != it1_end && it1e != it1e_end) {
|
||||
int compare = it1.index1 () - it1e.index1 ();
|
||||
if (compare == 0) {
|
||||
functor_type () (*it1, *it1e);
|
||||
functor1_type () (*it1, *it1e);
|
||||
++ it1, ++ it1e;
|
||||
} else if (compare < 0) {
|
||||
#ifdef BOOST_UBLAS_NON_CONFORMANT_PROXIES
|
||||
// Sparse proxies don't need to be conformant.
|
||||
// Thanks to Michael Stevens for suggesting this.
|
||||
size_type index1 (it1.index1 ()), index2 (it1.index2 ());
|
||||
functor_type () (m (index1, index2), e () (index1, index2));
|
||||
restart (e, index1, index2, it2e, it2e_end, it1e, it1e_end, column_major_tag ());
|
||||
// The proxies could reference the same container.
|
||||
restart (m, index1, index2, it2, it2_end, it1, it1_end, column_major_tag ());
|
||||
if (functor2_type::other (index1, index2)) {
|
||||
functor1_type () (m (index1, index2), e () (index1, index2));
|
||||
restart (e, index1, index2, it2e, it2e_end, it1e, it1e_end, column_major_tag ());
|
||||
// The proxies could reference the same container.
|
||||
restart (m, index1, index2, it2, it2_end, it1, it1_end, column_major_tag ());
|
||||
} else {
|
||||
++ it1;
|
||||
}
|
||||
#else
|
||||
++ it1;
|
||||
#endif
|
||||
} else if (compare > 0) {
|
||||
#ifdef BOOST_UBLAS_NON_CONFORMANT_PROXIES
|
||||
// Sparse proxies don't need to be conformant.
|
||||
// Thanks to Michael Stevens for suggesting this.
|
||||
size_type index1 (it1e.index1 ()), index2 (it1e.index2 ());
|
||||
functor_type () (m (index1, index2), e () (index1, index2));
|
||||
restart (m, index1, index2, it2, it2_end, it1, it1_end, column_major_tag ());
|
||||
// The proxies could reference the same container.
|
||||
restart (e, index1, index2, it2e, it2e_end, it1e, it1e_end, column_major_tag ());
|
||||
if (functor2_type::other (index1, index2)) {
|
||||
functor1_type () (m (index1, index2), e () (index1, index2));
|
||||
restart (m, index1, index2, it2, it2_end, it1, it1_end, column_major_tag ());
|
||||
// The proxies could reference the same container.
|
||||
restart (e, index1, index2, it2e, it2e_end, it1e, it1e_end, column_major_tag ());
|
||||
} else {
|
||||
++ it1e;
|
||||
}
|
||||
#else
|
||||
++ it1e;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -1271,19 +1377,27 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
// Sparse proxies don't need to be conformant.
|
||||
// Thanks to Michael Stevens for suggesting this.
|
||||
size_type index1 (it1e.index1 ()), index2 (it1e.index2 ());
|
||||
functor_type () (m (index1, index2), e () (index1, index2));
|
||||
// The proxies could reference the same container.
|
||||
restart (e, index1, index2, it2e, it2e_end, it1e, it1e_end, column_major_tag ());
|
||||
restart (m, index1, index2, it2, it2_end, it1, it1_end, column_major_tag ());
|
||||
if (functor2_type::other (index1, index2)) {
|
||||
functor1_type () (m (index1, index2), e () (index1, index2));
|
||||
// The proxies could reference the same container.
|
||||
restart (e, index1, index2, it2e, it2e_end, it1e, it1e_end, column_major_tag ());
|
||||
restart (m, index1, index2, it2, it2_end, it1, it1_end, column_major_tag ());
|
||||
} else {
|
||||
++ it1e;
|
||||
}
|
||||
}
|
||||
while (it1 != it1_end) {
|
||||
// Sparse proxies don't need to be conformant.
|
||||
// Thanks to Michael Stevens for suggesting this.
|
||||
size_type index1 (it1.index1 ()), index2 (it1.index2 ());
|
||||
functor_type () (m (index1, index2), e () (index1, index2));
|
||||
// The proxies could reference the same container.
|
||||
restart (m, index1, index2, it2, it2_end, it1, it1_end, column_major_tag ());
|
||||
restart (e, index1, index2, it2e, it2e_end, it1e, it1e_end, column_major_tag ());
|
||||
if (functor2_type::other (index1, index2)) {
|
||||
functor1_type () (m (index1, index2), e () (index1, index2));
|
||||
// The proxies could reference the same container.
|
||||
restart (m, index1, index2, it2, it2_end, it1, it1_end, column_major_tag ());
|
||||
restart (e, index1, index2, it2e, it2e_end, it1e, it1e_end, column_major_tag ());
|
||||
} else {
|
||||
++ it1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
++ it2, ++ it2e;
|
||||
@@ -1297,10 +1411,14 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
// Sparse proxies don't need to be conformant.
|
||||
// Thanks to Michael Stevens for suggesting this.
|
||||
size_type index1 (it1.index1 ()), index2 (it1.index2 ());
|
||||
functor_type () (m (index1, index2), e () (index1, index2));
|
||||
// The proxies could reference the same container.
|
||||
restart (m, index1, index2, it2, it2_end, it1, it1_end, column_major_tag ());
|
||||
restart (e, index1, index2, it2e, it2e_end, it1e, it1e_end, column_major_tag ());
|
||||
if (functor2_type::other (index1, index2)) {
|
||||
functor1_type () (m (index1, index2), e () (index1, index2));
|
||||
// The proxies could reference the same container.
|
||||
restart (m, index1, index2, it2, it2_end, it1, it1_end, column_major_tag ());
|
||||
restart (e, index1, index2, it2e, it2e_end, it1e, it1e_end, column_major_tag ());
|
||||
} else {
|
||||
++ it1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
++ it2;
|
||||
@@ -1314,10 +1432,14 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
// Sparse proxies don't need to be conformant.
|
||||
// Thanks to Michael Stevens for suggesting this.
|
||||
size_type index1 (it1e.index1 ()), index2 (it1e.index2 ());
|
||||
functor_type () (m (index1, index2), e () (index1, index2));
|
||||
// The proxies could reference the same container.
|
||||
restart (e, index1, index2, it2e, it2e_end, it1e, it1e_end, column_major_tag ());
|
||||
restart (m, index1, index2, it2, it2_end, it1, it1_end, column_major_tag ());
|
||||
if (functor2_type::other (index1, index2)) {
|
||||
functor1_type () (m (index1, index2), e () (index1, index2));
|
||||
// The proxies could reference the same container.
|
||||
restart (e, index1, index2, it2e, it2e_end, it1e, it1e_end, column_major_tag ());
|
||||
restart (m, index1, index2, it2, it2_end, it1, it1_end, column_major_tag ());
|
||||
} else {
|
||||
++ it1e;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
++ it2e;
|
||||
@@ -1333,10 +1455,14 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
// Sparse proxies don't need to be conformant.
|
||||
// Thanks to Michael Stevens for suggesting this.
|
||||
size_type index1 (it1e.index1 ()), index2 (it1e.index2 ());
|
||||
functor_type () (m (index1, index2), e () (index1, index2));
|
||||
// The proxies could reference the same container.
|
||||
restart (e, index1, index2, it2e, it2e_end, it1e, it1e_end, column_major_tag ());
|
||||
restart (m, index1, index2, it2, it2_end, it1, it1_end, column_major_tag ());
|
||||
if (functor2_type::other (index1, index2)) {
|
||||
functor1_type () (m (index1, index2), e () (index1, index2));
|
||||
// The proxies could reference the same container.
|
||||
restart (e, index1, index2, it2e, it2e_end, it1e, it1e_end, column_major_tag ());
|
||||
restart (m, index1, index2, it2, it2_end, it1, it1_end, column_major_tag ());
|
||||
} else {
|
||||
++ it1e;
|
||||
}
|
||||
}
|
||||
++ it2e;
|
||||
}
|
||||
@@ -1349,10 +1475,14 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
// Sparse proxies don't need to be conformant.
|
||||
// Thanks to Michael Stevens for suggesting this.
|
||||
size_type index1 (it1.index1 ()), index2 (it1.index2 ());
|
||||
functor_type () (m (index1, index2), e () (index1, index2));
|
||||
// The proxies could reference the same container.
|
||||
restart (m, index1, index2, it2, it2_end, it1, it1_end, column_major_tag ());
|
||||
restart (e, index1, index2, it2e, it2e_end, it1e, it1e_end, column_major_tag ());
|
||||
if (functor2_type::other (index1, index2)) {
|
||||
functor1_type () (m (index1, index2), e () (index1, index2));
|
||||
// The proxies could reference the same container.
|
||||
restart (m, index1, index2, it2, it2_end, it1, it1_end, column_major_tag ());
|
||||
restart (e, index1, index2, it2e, it2e_end, it1e, it1e_end, column_major_tag ());
|
||||
} else {
|
||||
++ it1;
|
||||
}
|
||||
}
|
||||
++ it2;
|
||||
}
|
||||
@@ -1370,7 +1500,20 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
// FIXME: can't we improve the dispatch here?
|
||||
// typedef typename E::orientation_category orientation_category;
|
||||
typedef typename M::orientation_category orientation_category;
|
||||
matrix_swap (functor_type (), m, e, storage_category (), orientation_category ());
|
||||
matrix_swap (functor_type (), m, e, full (), storage_category (), orientation_category ());
|
||||
}
|
||||
template<class F1, class M, class E, class F2>
|
||||
BOOST_UBLAS_INLINE
|
||||
void matrix_swap (const F1 &f1, M &m, matrix_expression<E> &e, const F2 &f2) {
|
||||
typedef F1 functor1_type;
|
||||
typedef F2 functor2_type;
|
||||
typedef typename matrix_swap_traits<BOOST_UBLAS_TYPENAME M::storage_category,
|
||||
BOOST_UBLAS_TYPENAME E::const_iterator1::iterator_category,
|
||||
BOOST_UBLAS_TYPENAME E::const_iterator2::iterator_category>::storage_category storage_category;
|
||||
// FIXME: can't we improve the dispatch here?
|
||||
// typedef typename E::orientation_category orientation_category;
|
||||
typedef typename M::orientation_category orientation_category;
|
||||
matrix_swap (functor1_type (), m, e, functor2_type (), storage_category (), orientation_category ());
|
||||
}
|
||||
|
||||
}}}
|
||||
|
||||
@@ -1060,7 +1060,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
// Assignment
|
||||
BOOST_UBLAS_INLINE
|
||||
symmetric_adaptor &operator = (const symmetric_adaptor &m) {
|
||||
matrix_assign (scalar_assign<value_type, value_type> (), *this, m);
|
||||
matrix_assign (scalar_assign<value_type, value_type> (), *this, m, functor_type ());
|
||||
return *this;
|
||||
}
|
||||
BOOST_UBLAS_INLINE
|
||||
@@ -1071,37 +1071,37 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
template<class AE>
|
||||
BOOST_UBLAS_INLINE
|
||||
symmetric_adaptor &operator = (const matrix_expression<AE> &ae) {
|
||||
matrix_assign (scalar_assign<value_type, value_type> (), *this, matrix<value_type> (ae));
|
||||
matrix_assign (scalar_assign<value_type, value_type> (), *this, matrix<value_type> (ae), functor_type ());
|
||||
return *this;
|
||||
}
|
||||
template<class AE>
|
||||
BOOST_UBLAS_INLINE
|
||||
symmetric_adaptor &assign (const matrix_expression<AE> &ae) {
|
||||
matrix_assign (scalar_assign<value_type, BOOST_UBLAS_TYPENAME AE::value_type> (), *this, ae);
|
||||
matrix_assign (scalar_assign<value_type, BOOST_UBLAS_TYPENAME AE::value_type> (), *this, ae, functor_type ());
|
||||
return *this;
|
||||
}
|
||||
template<class AE>
|
||||
BOOST_UBLAS_INLINE
|
||||
symmetric_adaptor& operator += (const matrix_expression<AE> &ae) {
|
||||
matrix_assign (scalar_assign<value_type, value_type> (), *this, matrix<value_type> (*this + ae));
|
||||
matrix_assign (scalar_assign<value_type, value_type> (), *this, matrix<value_type> (*this + ae), functor_type ());
|
||||
return *this;
|
||||
}
|
||||
template<class AE>
|
||||
BOOST_UBLAS_INLINE
|
||||
symmetric_adaptor &plus_assign (const matrix_expression<AE> &ae) {
|
||||
matrix_assign (scalar_plus_assign<value_type, BOOST_UBLAS_TYPENAME AE::value_type> (), *this, ae);
|
||||
matrix_assign (scalar_plus_assign<value_type, BOOST_UBLAS_TYPENAME AE::value_type> (), *this, ae, functor_type ());
|
||||
return *this;
|
||||
}
|
||||
template<class AE>
|
||||
BOOST_UBLAS_INLINE
|
||||
symmetric_adaptor& operator -= (const matrix_expression<AE> &ae) {
|
||||
matrix_assign (scalar_assign<value_type, value_type> (), *this, matrix<value_type> (*this - ae));
|
||||
matrix_assign (scalar_assign<value_type, value_type> (), *this, matrix<value_type> (*this - ae), functor_type ());
|
||||
return *this;
|
||||
}
|
||||
template<class AE>
|
||||
BOOST_UBLAS_INLINE
|
||||
symmetric_adaptor &minus_assign (const matrix_expression<AE> &ae) {
|
||||
matrix_assign (scalar_minus_assign<value_type, BOOST_UBLAS_TYPENAME AE::value_type> (), *this, ae);
|
||||
matrix_assign (scalar_minus_assign<value_type, BOOST_UBLAS_TYPENAME AE::value_type> (), *this, ae, functor_type ());
|
||||
return *this;
|
||||
}
|
||||
template<class AT>
|
||||
@@ -1123,7 +1123,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
// Too unusual semantic
|
||||
// BOOST_UBLAS_CHECK (this != &m, external_logic ());
|
||||
if (this != &m)
|
||||
matrix_swap (scalar_swap<value_type, value_type> (), *this, m);
|
||||
matrix_swap (scalar_swap<value_type, value_type> (), *this, m, functor_type ());
|
||||
}
|
||||
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
BOOST_UBLAS_INLINE
|
||||
|
||||
@@ -1812,10 +1812,17 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
BOOST_UBLAS_CHECK (e1 ().size2 () == e2.size (), bad_size ());
|
||||
size_type size = e2.size ();
|
||||
for (size_type n = 0; n < size; ++ n) {
|
||||
#ifndef BOOST_UBLAS_SINGULAR_CHECK
|
||||
BOOST_UBLAS_CHECK (e1 () (n, n) != value_type (), singular ());
|
||||
#else
|
||||
if (e1 () (n, n) == value_type ())
|
||||
singular.raise ();
|
||||
#endif
|
||||
value_type t = e2 (n) /= e1 () (n, n);
|
||||
for (size_type m = n + 1; m < size; ++ m)
|
||||
e2 (m) -= e1 () (m, n) * t;
|
||||
if (t != value_type ()) {
|
||||
for (size_type m = n + 1; m < size; ++ m)
|
||||
e2 (m) -= e1 () (m, n) * t;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Packed (proxy) case
|
||||
@@ -1831,13 +1838,20 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
BOOST_UBLAS_CHECK (e1 ().size2 () == e2.size (), bad_size ());
|
||||
size_type size = e2.size ();
|
||||
for (size_type n = 0; n < size; ++ n) {
|
||||
#ifndef BOOST_UBLAS_SINGULAR_CHECK
|
||||
BOOST_UBLAS_CHECK (e1 () (n, n) != value_type (), singular ());
|
||||
#else
|
||||
if (e1 () (n, n) == value_type ())
|
||||
singular.raise ();
|
||||
#endif
|
||||
value_type t = e2 (n) /= e1 () (n, n);
|
||||
typename E1::const_iterator1 it1e1 (e1 ().find_first1 (1, n + 1, n));
|
||||
typename E1::const_iterator1 it1e1_end (e1 ().find_first1 (1, e1 ().size1 (), n));
|
||||
difference_type m (it1e1_end - it1e1);
|
||||
while (-- m >= 0)
|
||||
e2 (it1e1.index1 ()) -= *it1e1 * t, ++ it1e1;
|
||||
if (t != value_type ()) {
|
||||
typename E1::const_iterator1 it1e1 (e1 ().find_first1 (1, n + 1, n));
|
||||
typename E1::const_iterator1 it1e1_end (e1 ().find_first1 (1, e1 ().size1 (), n));
|
||||
difference_type m (it1e1_end - it1e1);
|
||||
while (-- m >= 0)
|
||||
e2 (it1e1.index1 ()) -= *it1e1 * t, ++ it1e1;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Sparse (proxy) case
|
||||
@@ -1853,12 +1867,19 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
BOOST_UBLAS_CHECK (e1 ().size2 () == e2.size (), bad_size ());
|
||||
size_type size = e2.size ();
|
||||
for (size_type n = 0; n < size; ++ n) {
|
||||
#ifndef BOOST_UBLAS_SINGULAR_CHECK
|
||||
BOOST_UBLAS_CHECK (e1 () (n, n) != value_type (), singular ());
|
||||
#else
|
||||
if (e1 () (n, n) == value_type ())
|
||||
singular.raise ();
|
||||
#endif
|
||||
value_type t = e2 (n) /= e1 () (n, n);
|
||||
typename E1::const_iterator1 it1e1 (e1 ().find_first1 (1, n + 1, n));
|
||||
typename E1::const_iterator1 it1e1_end (e1 ().find_first1 (1, e1 ().size1 (), n));
|
||||
while (it1e1 != it1e1_end)
|
||||
e2 (it1e1.index1 ()) -= *it1e1 * t, ++ it1e1;
|
||||
if (t != value_type ()) {
|
||||
typename E1::const_iterator1 it1e1 (e1 ().find_first1 (1, n + 1, n));
|
||||
typename E1::const_iterator1 it1e1_end (e1 ().find_first1 (1, e1 ().size1 (), n));
|
||||
while (it1e1 != it1e1_end)
|
||||
e2 (it1e1.index1 ()) -= *it1e1 * t, ++ it1e1;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Dispatcher
|
||||
@@ -1883,10 +1904,17 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
BOOST_UBLAS_CHECK (e1 ().size2 () == e2.size (), bad_size ());
|
||||
size_type size = e2.size ();
|
||||
for (difference_type n = size - 1; n >= 0; -- n) {
|
||||
#ifndef BOOST_UBLAS_SINGULAR_CHECK
|
||||
BOOST_UBLAS_CHECK (e1 () (n, n) != value_type (), singular ());
|
||||
#else
|
||||
if (e1 () (n, n) == value_type ())
|
||||
singular.raise ();
|
||||
#endif
|
||||
value_type t = e2 (n) /= e1 () (n, n);
|
||||
for (difference_type m = n - 1; m >= 0; -- m)
|
||||
e2 (m) -= e1 () (m, n) * t;
|
||||
if (t != value_type ()) {
|
||||
for (difference_type m = n - 1; m >= 0; -- m)
|
||||
e2 (m) -= e1 () (m, n) * t;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Packed (proxy) case
|
||||
@@ -1902,13 +1930,20 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
BOOST_UBLAS_CHECK (e1 ().size2 () == e2.size (), bad_size ());
|
||||
size_type size = e2.size ();
|
||||
for (difference_type n = size - 1; n >= 0; -- n) {
|
||||
#ifndef BOOST_UBLAS_SINGULAR_CHECK
|
||||
BOOST_UBLAS_CHECK (e1 () (n, n) != value_type (), singular ());
|
||||
#else
|
||||
if (e1 () (n, n) == value_type ())
|
||||
singular.raise ();
|
||||
#endif
|
||||
value_type t = e2 (n) /= e1 () (n, n);
|
||||
typename E1::const_reverse_iterator1 it1e1 (e1 ().find_first1 (1, n, n));
|
||||
typename E1::const_reverse_iterator1 it1e1_rend (e1 ().find_first1 (1, 0, n));
|
||||
difference_type m (it1e1_rend - it1e1);
|
||||
while (-- m >= 0)
|
||||
e2 (it1e1.index1 ()) -= *it1e1 * t, ++ it1e1;
|
||||
if (t != value_type ()) {
|
||||
typename E1::const_reverse_iterator1 it1e1 (e1 ().find_first1 (1, n, n));
|
||||
typename E1::const_reverse_iterator1 it1e1_rend (e1 ().find_first1 (1, 0, n));
|
||||
difference_type m (it1e1_rend - it1e1);
|
||||
while (-- m >= 0)
|
||||
e2 (it1e1.index1 ()) -= *it1e1 * t, ++ it1e1;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Sparse (proxy) case
|
||||
@@ -1924,12 +1959,19 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
BOOST_UBLAS_CHECK (e1 ().size2 () == e2.size (), bad_size ());
|
||||
size_type size = e2.size ();
|
||||
for (difference_type n = size - 1; n >= 0; -- n) {
|
||||
#ifndef BOOST_UBLAS_SINGULAR_CHECK
|
||||
BOOST_UBLAS_CHECK (e1 () (n, n) != value_type (), singular ());
|
||||
#else
|
||||
if (e1 () (n, n) == value_type ())
|
||||
singular.raise ();
|
||||
#endif
|
||||
value_type t = e2 (n) /= e1 () (n, n);
|
||||
typename E1::const_reverse_iterator1 it1e1 (e1 ().find_first1 (1, n, n));
|
||||
typename E1::const_reverse_iterator1 it1e1_rend (e1 ().find_first1 (1, 0, n));
|
||||
while (it1e1 != it1e1_rend)
|
||||
e2 (it1e1.index1 ()) -= *it1e1 * t, ++ it1e1;
|
||||
if (t != value_type ()) {
|
||||
typename E1::const_reverse_iterator1 it1e1 (e1 ().find_first1 (1, n, n));
|
||||
typename E1::const_reverse_iterator1 it1e1_rend (e1 ().find_first1 (1, 0, n));
|
||||
while (it1e1 != it1e1_rend)
|
||||
e2 (it1e1.index1 ()) -= *it1e1 * t, ++ it1e1;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Dispatcher
|
||||
@@ -1946,7 +1988,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
void inplace_solve (const matrix_expression<E1> &e1,
|
||||
vector_expression<E2> &e2,
|
||||
C) {
|
||||
inplace_solve (e1, e2, C (), vector_tag ());
|
||||
inplace_solve (e1, e2 (), C (), vector_tag ());
|
||||
}
|
||||
template<class E1, class E2, class C>
|
||||
BOOST_UBLAS_INLINE
|
||||
@@ -1972,10 +2014,17 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
BOOST_UBLAS_CHECK (e2 ().size1 () == e2 ().size2 (), bad_size ());
|
||||
size_type size = e1.size ();
|
||||
for (size_type n = 0; n < size; ++ n) {
|
||||
#ifndef BOOST_UBLAS_SINGULAR_CHECK
|
||||
BOOST_UBLAS_CHECK (e2 () (n, n) != value_type (), singular ());
|
||||
#else
|
||||
if (e2 () (n, n) == value_type ())
|
||||
singular.raise ();
|
||||
#endif
|
||||
value_type t = e1 (n) /= e2 () (n, n);
|
||||
for (size_type m = n + 1; m < size; ++ m)
|
||||
e1 (m) -= t * e2 () (n, m);
|
||||
if (t != value_type ()) {
|
||||
for (size_type m = n + 1; m < size; ++ m)
|
||||
e1 (m) -= t * e2 () (n, m);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Packed (proxy) case
|
||||
@@ -1991,15 +2040,22 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
BOOST_UBLAS_CHECK (e2 ().size1 () == e2 ().size2 (), bad_size ());
|
||||
size_type size = e1.size ();
|
||||
for (size_type n = 0; n < size; ++ n) {
|
||||
#ifndef BOOST_UBLAS_SINGULAR_CHECK
|
||||
BOOST_UBLAS_CHECK (e2 () (n, n) != value_type (), singular ());
|
||||
#else
|
||||
if (e2 () (n, n) == value_type ())
|
||||
singular.raise ();
|
||||
#endif
|
||||
value_type t = e1 (n) /= e2 () (n, n);
|
||||
typename E1::iterator ite1 (e1.find_first (n + 1));
|
||||
typename E1::iterator ite1_end (e1.find_first (e2 ().size ()));
|
||||
typename E2::const_iterator2 it2e2 (e2 ().find_first2 (1, n, n + 1));
|
||||
typename E2::const_iterator2 it2e2_end (e2 ().find_first2 (1, n, e2 ().size2 ()));
|
||||
difference_type m (it2e2_end - it2e2);
|
||||
while (-- m >= 0)
|
||||
e1 (it2e2.index2 ()) -= *it2e2 * t, ++ it2e2;
|
||||
if (t != value_type ()) {
|
||||
typename E1::iterator ite1 (e1.find_first (n + 1));
|
||||
typename E1::iterator ite1_end (e1.find_first (e2 ().size ()));
|
||||
typename E2::const_iterator2 it2e2 (e2 ().find_first2 (1, n, n + 1));
|
||||
typename E2::const_iterator2 it2e2_end (e2 ().find_first2 (1, n, e2 ().size2 ()));
|
||||
difference_type m (it2e2_end - it2e2);
|
||||
while (-- m >= 0)
|
||||
e1 (it2e2.index2 ()) -= *it2e2 * t, ++ it2e2;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Sparse (proxy) case
|
||||
@@ -2015,12 +2071,19 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
BOOST_UBLAS_CHECK (e2 ().size1 () == e2 ().size2 (), bad_size ());
|
||||
size_type size = e1.size ();
|
||||
for (size_type n = 0; n < size; ++ n) {
|
||||
#ifndef BOOST_UBLAS_SINGULAR_CHECK
|
||||
BOOST_UBLAS_CHECK (e2 () (n, n) != value_type (), singular ());
|
||||
#else
|
||||
if (e2 () (n, n) == value_type ())
|
||||
singular.raise ();
|
||||
#endif
|
||||
value_type t = e1 (n) /= e2 () (n, n);
|
||||
typename E2::const_iterator2 it2e2 (e2 ().find_first2 (1, n, n + 1));
|
||||
typename E2::const_iterator2 it2e2_end (e2 ().find_first2 (1, n, e2 ().size2 ()));
|
||||
while (it2e2 != it2e2_end)
|
||||
e1 (it2e2.index2 ()) -= *it2e2 * t, ++ it2e2;
|
||||
if (t != value_type ()) {
|
||||
typename E2::const_iterator2 it2e2 (e2 ().find_first2 (1, n, n + 1));
|
||||
typename E2::const_iterator2 it2e2_end (e2 ().find_first2 (1, n, e2 ().size2 ()));
|
||||
while (it2e2 != it2e2_end)
|
||||
e1 (it2e2.index2 ()) -= *it2e2 * t, ++ it2e2;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Dispatcher
|
||||
@@ -2045,10 +2108,17 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
BOOST_UBLAS_CHECK (e2.size1 () == e2.size2 (), bad_size ());
|
||||
size_type size = e1.size ();
|
||||
for (difference_type n = size - 1; n >= 0; -- n) {
|
||||
#ifndef BOOST_UBLAS_SINGULAR_CHECK
|
||||
BOOST_UBLAS_CHECK (e2 (n, n) != value_type (), singular ());
|
||||
#else
|
||||
if (e2 () (n, n) == value_type ())
|
||||
singular.raise ();
|
||||
#endif
|
||||
value_type t = e1 (n) /= e2 (n, n);
|
||||
for (difference_type m = n - 1; m >= 0; -- m)
|
||||
e1 (m) -= t * e2 (n, m);
|
||||
if (t != value_type ()) {
|
||||
for (difference_type m = n - 1; m >= 0; -- m)
|
||||
e1 (m) -= t * e2 (n, m);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Packed (proxy) case
|
||||
@@ -2064,13 +2134,20 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
BOOST_UBLAS_CHECK (e2.size1 () == e2.size2 (), bad_size ());
|
||||
size_type size = e1.size ();
|
||||
for (difference_type n = size - 1; n >= 0; -- n) {
|
||||
#ifndef BOOST_UBLAS_SINGULAR_CHECK
|
||||
BOOST_UBLAS_CHECK (e2 (n, n) != value_type (), singular ());
|
||||
#else
|
||||
if (e2 () (n, n) == value_type ())
|
||||
singular.raise ();
|
||||
#endif
|
||||
value_type t = e1 (n) /= e2 (n, n);
|
||||
typename E2::const_reverse_iterator2 it2e2 (e2 ().find_first2 (1, n, n));
|
||||
typename E2::const_reverse_iterator2 it2e2_rend (e2 ().find_first2 (1, n, 0));
|
||||
difference_type m (it2e2_rend - it2e2);
|
||||
while (-- m >= 0)
|
||||
e1 (it2e2.index2 ()) -= *it2e2 * t, ++ it2e2;
|
||||
if (t != value_type ()) {
|
||||
typename E2::const_reverse_iterator2 it2e2 (e2 ().find_first2 (1, n, n));
|
||||
typename E2::const_reverse_iterator2 it2e2_rend (e2 ().find_first2 (1, n, 0));
|
||||
difference_type m (it2e2_rend - it2e2);
|
||||
while (-- m >= 0)
|
||||
e1 (it2e2.index2 ()) -= *it2e2 * t, ++ it2e2;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Sparse (proxy) case
|
||||
@@ -2086,12 +2163,19 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
BOOST_UBLAS_CHECK (e2.size1 () == e2.size2 (), bad_size ());
|
||||
size_type size = e1.size ();
|
||||
for (difference_type n = size - 1; n >= 0; -- n) {
|
||||
#ifndef BOOST_UBLAS_SINGULAR_CHECK
|
||||
BOOST_UBLAS_CHECK (e2 (n, n) != value_type (), singular ());
|
||||
#else
|
||||
if (e2 () (n, n) == value_type ())
|
||||
singular.raise ();
|
||||
#endif
|
||||
value_type t = e1 (n) /= e2 (n, n);
|
||||
typename E2::const_reverse_iterator2 it2e2 (e2 ().find_first2 (1, n, n));
|
||||
typename E2::const_reverse_iterator2 it2e2_rend (e2 ().find_first2 (1, n, 0));
|
||||
while (it2e2 != it2e2_rend)
|
||||
e1 (it2e2.index2 ()) -= *it2e2 * t, ++ it2e2;
|
||||
if (t != value_type ()) {
|
||||
typename E2::const_reverse_iterator2 it2e2 (e2 ().find_first2 (1, n, n));
|
||||
typename E2::const_reverse_iterator2 it2e2_rend (e2 ().find_first2 (1, n, 0));
|
||||
while (it2e2 != it2e2_rend)
|
||||
e1 (it2e2.index2 ()) -= *it2e2 * t, ++ it2e2;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Dispatcher
|
||||
@@ -2108,7 +2192,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
void inplace_solve (vector_expression<E1> &e1,
|
||||
const matrix_expression<E2> &e2,
|
||||
C) {
|
||||
inplace_solve (e1, e2, vector_tag (), C ());
|
||||
inplace_solve (e1 (), e2, vector_tag (), C ());
|
||||
}
|
||||
template<class E1, class E2, class C>
|
||||
BOOST_UBLAS_INLINE
|
||||
@@ -2145,11 +2229,18 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
size_type size1 = e2.size1 ();
|
||||
size_type size2 = e2.size2 ();
|
||||
for (size_type n = 0; n < size1; ++ n) {
|
||||
#ifndef BOOST_UBLAS_SINGULAR_CHECK
|
||||
BOOST_UBLAS_CHECK (e1 () (n, n) != value_type (), singular ());
|
||||
#else
|
||||
if (e1 () (n, n) == value_type ())
|
||||
singular.raise ();
|
||||
#endif
|
||||
for (size_type l = 0; l < size2; ++ l) {
|
||||
value_type t = e2 (n, l) /= e1 () (n, n);
|
||||
for (size_type m = n + 1; m < size1; ++ m)
|
||||
e2 (m, l) -= e1 () (m, n) * t;
|
||||
if (t != value_type ()) {
|
||||
for (size_type m = n + 1; m < size1; ++ m)
|
||||
e2 (m, l) -= e1 () (m, n) * t;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2167,14 +2258,21 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
size_type size1 = e2.size1 ();
|
||||
size_type size2 = e2.size2 ();
|
||||
for (size_type n = 0; n < size1; ++ n) {
|
||||
#ifndef BOOST_UBLAS_SINGULAR_CHECK
|
||||
BOOST_UBLAS_CHECK (e1 () (n, n) != value_type (), singular ());
|
||||
#else
|
||||
if (e1 () (n, n) == value_type ())
|
||||
singular.raise ();
|
||||
#endif
|
||||
for (size_type l = 0; l < size2; ++ l) {
|
||||
value_type t = e2 (n, l) /= e1 () (n, n);
|
||||
typename E1::const_iterator1 it1e1 (e1 ().find_first1 (1, n + 1, n));
|
||||
typename E1::const_iterator1 it1e1_end (e1 ().find_first1 (1, e1 ().size1 (), n));
|
||||
difference_type m (it1e1_end - it1e1);
|
||||
while (-- m >= 0)
|
||||
e2 (it1e1.index1 (), l) -= *it1e1 * t, ++ it1e1;
|
||||
if (t != value_type ()) {
|
||||
typename E1::const_iterator1 it1e1 (e1 ().find_first1 (1, n + 1, n));
|
||||
typename E1::const_iterator1 it1e1_end (e1 ().find_first1 (1, e1 ().size1 (), n));
|
||||
difference_type m (it1e1_end - it1e1);
|
||||
while (-- m >= 0)
|
||||
e2 (it1e1.index1 (), l) -= *it1e1 * t, ++ it1e1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2192,13 +2290,20 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
size_type size1 = e2.size1 ();
|
||||
size_type size2 = e2.size2 ();
|
||||
for (size_type n = 0; n < size1; ++ n) {
|
||||
#ifndef BOOST_UBLAS_SINGULAR_CHECK
|
||||
BOOST_UBLAS_CHECK (e1 () (n, n) != value_type (), singular ());
|
||||
#else
|
||||
if (e1 () (n, n) == value_type ())
|
||||
singular.raise ();
|
||||
#endif
|
||||
for (size_type l = 0; l < size2; ++ l) {
|
||||
value_type t = e2 (n, l) /= e1 () (n, n);
|
||||
typename E1::const_iterator1 it1e1 (e1 ().find_first1 (1, n + 1, n));
|
||||
typename E1::const_iterator1 it1e1_end (e1 ().find_first1 (1, e1 ().size1 (), n));
|
||||
while (it1e1 != it1e1_end)
|
||||
e2 (it1e1.index1 (), l) -= *it1e1 * t, ++ it1e1;
|
||||
if (t != value_type ()) {
|
||||
typename E1::const_iterator1 it1e1 (e1 ().find_first1 (1, n + 1, n));
|
||||
typename E1::const_iterator1 it1e1_end (e1 ().find_first1 (1, e1 ().size1 (), n));
|
||||
while (it1e1 != it1e1_end)
|
||||
e2 (it1e1.index1 (), l) -= *it1e1 * t, ++ it1e1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2225,11 +2330,18 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
size_type size1 = e2.size1 ();
|
||||
size_type size2 = e2.size2 ();
|
||||
for (difference_type n = size1 - 1; n >= 0; -- n) {
|
||||
#ifndef BOOST_UBLAS_SINGULAR_CHECK
|
||||
BOOST_UBLAS_CHECK (e1 () (n, n) != value_type (), singular ());
|
||||
#else
|
||||
if (e1 () (n, n) == value_type ())
|
||||
singular.raise ();
|
||||
#endif
|
||||
for (difference_type l = size2 - 1; l >= 0; -- l) {
|
||||
value_type t = e2 (n, l) /= e1 () (n, n);
|
||||
for (difference_type m = n - 1; m >= 0; -- m)
|
||||
e2 (m, l) -= e1 () (m, n) * t;
|
||||
if (t != value_type ()) {
|
||||
for (difference_type m = n - 1; m >= 0; -- m)
|
||||
e2 (m, l) -= e1 () (m, n) * t;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2247,14 +2359,21 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
size_type size1 = e2.size1 ();
|
||||
size_type size2 = e2.size2 ();
|
||||
for (difference_type n = size1 - 1; n >= 0; -- n) {
|
||||
#ifndef BOOST_UBLAS_SINGULAR_CHECK
|
||||
BOOST_UBLAS_CHECK (e1 () (n, n) != value_type (), singular ());
|
||||
#else
|
||||
if (e1 () (n, n) == value_type ())
|
||||
singular.raise ();
|
||||
#endif
|
||||
for (difference_type l = size2 - 1; l >= 0; -- l) {
|
||||
value_type t = e2 (n, l) /= e1 () (n, n);
|
||||
typename E1::const_reverse_iterator1 it1e1 (e1 ().find_first1 (1, n, n));
|
||||
typename E1::const_reverse_iterator1 it1e1_rend (e1 ().find_first1 (1, 0, n));
|
||||
difference_type m (it1e1_rend - it1e1);
|
||||
while (-- m >= 0)
|
||||
e2 (it1e1.index1 (), l) -= *it1e1 * t, ++ it1e1;
|
||||
if (t != value_type ()) {
|
||||
typename E1::const_reverse_iterator1 it1e1 (e1 ().find_first1 (1, n, n));
|
||||
typename E1::const_reverse_iterator1 it1e1_rend (e1 ().find_first1 (1, 0, n));
|
||||
difference_type m (it1e1_rend - it1e1);
|
||||
while (-- m >= 0)
|
||||
e2 (it1e1.index1 (), l) -= *it1e1 * t, ++ it1e1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2272,13 +2391,19 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
size_type size1 = e2.size1 ();
|
||||
size_type size2 = e2.size2 ();
|
||||
for (difference_type n = size1 - 1; n >= 0; -- n) {
|
||||
#ifndef BOOST_UBLAS_SINGULAR_CHECK
|
||||
BOOST_UBLAS_CHECK (e1 () (n, n) != value_type (), singular ());
|
||||
#else
|
||||
if (e1 () (n, n) == value_type ())
|
||||
singular.raise ();
|
||||
#endif
|
||||
for (difference_type l = size2 - 1; l >= 0; -- l) {
|
||||
value_type t = e2 (n, l) /= e1 () (n, n);
|
||||
typename E1::const_reverse_iterator1 it1e1 (e1 ().find_first1 (1, n, n));
|
||||
typename E1::const_reverse_iterator1 it1e1_rend (e1 ().find_first1 (1, 0, n));
|
||||
while (it1e1 != it1e1_rend) {
|
||||
e2 (it1e1.index1 (), l) -= *it1e1 * t, ++ it1e1;
|
||||
if (t != value_type ()) {
|
||||
typename E1::const_reverse_iterator1 it1e1 (e1 ().find_first1 (1, n, n));
|
||||
typename E1::const_reverse_iterator1 it1e1_rend (e1 ().find_first1 (1, 0, n));
|
||||
while (it1e1 != it1e1_rend)
|
||||
e2 (it1e1.index1 (), l) -= *it1e1 * t, ++ it1e1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2297,7 +2422,7 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
void inplace_solve (const matrix_expression<E1> &e1,
|
||||
matrix_expression<E2> &e2,
|
||||
C) {
|
||||
inplace_solve (e1, e2, C (), matrix_tag ());
|
||||
inplace_solve (e1, e2 (), C (), matrix_tag ());
|
||||
}
|
||||
template<class E1, class E2, class C>
|
||||
BOOST_UBLAS_INLINE
|
||||
|
||||
@@ -386,6 +386,8 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
restart (v, index, it, it_end);
|
||||
// The proxies could reference the same container.
|
||||
restart (e, index, ite, ite_end);
|
||||
#else
|
||||
++ ite;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -489,6 +491,8 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
restart (v, index, it, it_end);
|
||||
// The proxies could reference the same container.
|
||||
restart (e, index, ite, ite_end);
|
||||
#else
|
||||
++ it;
|
||||
#endif
|
||||
} else if (compare > 0) {
|
||||
#ifdef BOOST_UBLAS_NON_CONFORMANT_PROXIES
|
||||
@@ -499,6 +503,8 @@ namespace boost { namespace numeric { namespace ublas {
|
||||
restart (e, index, ite, ite_end);
|
||||
// The proxies could reference the same container.
|
||||
restart (v, index, it, it_end);
|
||||
#else
|
||||
++ ite;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,6 +67,7 @@ struct test_my_vector {
|
||||
// Binary vector operations resulting in a vector
|
||||
initialize_vector (v1);
|
||||
initialize_vector (v2);
|
||||
initialize_vector (v3);
|
||||
v3 = v1 + v2;
|
||||
std::cout << "v1 + v2 = " << v3 << std::endl;
|
||||
|
||||
|
||||
@@ -63,6 +63,7 @@ struct test_my_matrix {
|
||||
// Binary matrix operations resulting in a matrix
|
||||
initialize_matrix (m1);
|
||||
initialize_matrix (m2);
|
||||
initialize_matrix (m3);
|
||||
m3 = m1 + m2;
|
||||
std::cout << "m1 + m2 = " << m3 << std::endl;
|
||||
m3 = m1 - m2;
|
||||
|
||||
Reference in New Issue
Block a user