single bug fix

This commit is contained in:
kradchen
2023-06-02 13:44:14 +08:00
parent c1eeadf72a
commit 9908202e9f
4 changed files with 21 additions and 10 deletions

View File

@@ -55,9 +55,17 @@ namespace Recon {
// 1))./(vecnorm(senderNormalBlock, 2, 1) .* vecnorm(receiverNormalBlock, 2,
// 1)
auto transData = ones(1, aMSenderNormalBlock.getDimSize(1));
auto inbetweenAngle = acosd(dot(aMSenderNormalBlock, aMReceiverNormalBlock) /
Aurora::Matrix inbetweenAngle;
{
auto tempM = dot(aMSenderNormalBlock, aMReceiverNormalBlock) /
(vecnorm(aMSenderNormalBlock, Norm2, 1) *
vecnorm(aMReceiverNormalBlock, Norm2, 1)));
vecnorm(aMReceiverNormalBlock, Norm2, 1));
float* temp = new float[tempM.getDataSize()]{0};
std::copy(tempM.getData(),tempM.getData()+tempM.getDataSize(),temp);
std::copy(temp,temp+tempM.getDataSize(),tempM.getData());
delete [] temp;
inbetweenAngle = acosd(tempM);
}
#pragma omp parallel for
for (size_t i = 0; i < transData.getDataSize(); i++)
{

View File

@@ -31,6 +31,12 @@ namespace Recon
Aurora::Matrix prepareAScansForTransmissionDetection(const Aurora::Matrix& aMaScanBlock, const Aurora::Matrix aVGainBlock)
{
auto ret = aMaScanBlock/Aurora::repmat(aVGainBlock,aMaScanBlock.getDimSize(0),1);
{
float* temp = new float[ret.getDataSize()]{0};
std::copy(ret.getData(),ret.getData()+ret.getDataSize(),temp);
std::copy(temp,temp+ret.getDataSize(),ret.getData());
delete [] temp;
}
ret = ret-Aurora::repmat(Aurora::mean(ret),aMaScanBlock.getDimSize(0),1);
return ret;
}

View File

@@ -220,9 +220,7 @@ namespace Recon
uint *temp = new uint[path.getDataSize()]{0};
//uint32(path)
std::copy(path.getData(),path.getData()+path.getDataSize(),temp);
std::copy(temp,temp+path.getDataSize(),path.getData());
delete [] temp;
Aurora::round(path);
result.weighting = traceLineResult.ds;
result.path = correctPathToImgDimensions(path, dims);
result.pathLen = result.path.getDimSize(0);

View File

@@ -170,6 +170,10 @@ namespace Recon
double * csrValues;
sparse_index_base_t index;
mkl_sparse_d_export_csr(csrA, &index, &n_rows, &n_cols, &rows_start, &rows_end, &col_indx, &csrValues);
mkl_sparse_destroy(A);
delete [] xIdxs;
delete [] yIdxs;
int *row_idx = new int[n_rows+1];
std::copy(rows_start,rows_start+n_rows,row_idx);
row_idx[n_rows] = rows_end[n_rows-1];
@@ -178,14 +182,9 @@ namespace Recon
size_t bDims[3]={(size_t)b.getDimSize(0),(size_t)b.getDimSize(1),(size_t)b.getDimSize(2)};
size_t rdims[3] = {(size_t)dims[0], (size_t)dims[1], (size_t)dims[2]};
bool pagelocked = false;
auto result = TVALGPU(row_idx, col_indx, csrValues, M.getM(), M.getN(), nz, bData, bDims, rdims, opt, device, false);
mkl_sparse_destroy(A);
mkl_sparse_destroy(csrA);
delete [] row_idx;
delete [] xIdxs;
delete [] yIdxs;
delete [] bData;
return Aurora::Matrix::fromRawData(result.data, result.dims[0],result.dims[1],result.dims[2]);
// return Aurora::Matrix();