VSをコンパイルする前に
エラー メンバ "test::A" は変数ではありません
エラー メンバ "test::B" は変数ではありません
コード:
#include <iostream>
#include <ppl.h>
using namespace concurrency;
using namespace std;
class test
{
static double A[ 3 ][ 3 ];
static double B[ 3 ][ 3 ];
public:
int test_function();
};
double test::A[ 3 ][ 3 ] = { { 0.7, -0.2, -1 },
{ -4, -2, -2 },
{ -0.4, 1.7, -1.8 } };
double test::B[ 3 ][ 3 ] = { { 0.6, -1.2, 1.1 },
{ 2, 3, -2 },
{ -1, 0.05, 0.05} };
int test::test_function()
{
parallel_for ( 0, 100, [ &A, &B ]( int y ) {
for ( int x = 0; x < 100; x++ ) {
for ( int i = 0; i < 3; i++ )
for ( int j = 0; j < 3; j++ )
A[ j ][ i ] += A[ j ][ i ] * B[ j ][ i ];
}
} );
}
int main()
{
return 0;
}
エラー:
'test::A': ラムダ キャプチャ変数は、囲んでいる関数スコープからのものでなければなりません
'test::B': ラムダ キャプチャ変数は、囲んでいる関数スコープからのものでなければなりません
私は何をすべきか?