aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/Dialogs/SafetyLevelOperationsConfirmationView.xaml.cs
blob: ef689f1de7e38bcd3516c2227419f76560a6f0ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Tango.PPC.UI.Dialogs
{
    /// <summary>
    /// Interaction logic for SafetyLevelOperationsConfirmationView.xaml
    /// </summary>
    public partial class SafetyLevelOperationsConfirmationView : UserControl
    {
        public SafetyLevelOperationsConfirmationView()
        {
            InitializeComponent();
        }
    }
}
ypename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols> struct other_matrix_type<Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> > { typedef Matrix<_Scalar, _Rows, _Cols, _Options^RowMajor, _MaxRows, _MaxCols> type; }; template<typename MatrixType> void swap(const MatrixType& m) { typedef typename other_matrix_type<MatrixType>::type OtherMatrixType; typedef typename MatrixType::Scalar Scalar; eigen_assert((!internal::is_same<MatrixType,OtherMatrixType>::value)); typename MatrixType::Index rows = m.rows(); typename MatrixType::Index cols = m.cols(); // construct 3 matrix guaranteed to be distinct MatrixType m1 = MatrixType::Random(rows,cols); MatrixType m2 = MatrixType::Random(rows,cols) + Scalar(100) * MatrixType::Identity(rows,cols); OtherMatrixType m3 = OtherMatrixType::Random(rows,cols) + Scalar(200) * OtherMatrixType::Identity(rows,cols); MatrixType m1_copy = m1; MatrixType m2_copy = m2; OtherMatrixType m3_copy = m3; // test swapping 2 matrices of same type Scalar *d1=m1.data(), *d2=m2.data(); m1.swap(m2); VERIFY_IS_APPROX(m1,m2_copy); VERIFY_IS_APPROX(m2,m1_copy); if(MatrixType::SizeAtCompileTime==Dynamic) { VERIFY(m1.data()==d2); VERIFY(m2.data()==d1); } m1 = m1_copy; m2 = m2_copy; // test swapping 2 matrices of different types m1.swap(m3); VERIFY_IS_APPROX(m1,m3_copy); VERIFY_IS_APPROX(m3,m1_copy); m1 = m1_copy; m3 = m3_copy; // test swapping matrix with expression m1.swap(m2.block(0,0,rows,cols)); VERIFY_IS_APPROX(m1,m2_copy); VERIFY_IS_APPROX(m2,m1_copy); m1 = m1_copy; m2 = m2_copy; // test swapping two expressions of different types m1.transpose().swap(m3.transpose()); VERIFY_IS_APPROX(m1,m3_copy); VERIFY_IS_APPROX(m3,m1_copy); m1 = m1_copy; m3 = m3_copy; if(m1.rows()>1) { // test assertion on mismatching size -- matrix case VERIFY_RAISES_ASSERT(m1.swap(m1.row(0))); // test assertion on mismatching size -- xpr case VERIFY_RAISES_ASSERT(m1.row(0).swap(m1)); } } void test_swap() { int s = internal::random<int>(1,EIGEN_TEST_MAX_SIZE); CALL_SUBTEST_1( swap(Matrix3f()) ); // fixed size, no vectorization CALL_SUBTEST_2( swap(Matrix4d()) ); // fixed size, possible vectorization CALL_SUBTEST_3( swap(MatrixXd(s,s)) ); // dyn size, no vectorization CALL_SUBTEST_4( swap(MatrixXf(s,s)) ); // dyn size, possible vectorization TEST_SET_BUT_UNUSED_VARIABLE(s) }