📄 initgrad.c
字号:
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// INTEL CORPORATION PROPRIETARY INFORMATION
// This software is supplied under the terms of a license agreement or
// nondisclosure agreement with Intel Corporation and may not be copied
// or disclosed except in accordance with the terms of that agreement.
// Copyright (c) 1999 Intel Corporation. All Rights Reserved.
//
// RCS:
// $Source: initgrad.c$
// $Revision: 00.00.05$
// Purpose:
// Contents:
// Authors:
// Sergey Oblomov
//
//M*/
#include "ats.h"
/*F///////////////////////////////////////////////////////////////////////////////////////
// Name: ats1flInitGrad
// Purpose:
// Initialazing float array by gradient randomize value (every previous
// value least next value)
// Context:
// Parameters:
// Min - minimal bound
// Max - maximum bound
// pDst - destination array
// lLen - size of array
// Returns:
// Notes:
//F*/
void ats1flInitGrad( double Min, double Max, float* pDst, long lLen )
{
/* Some variables */
int i;
float flStep;
assert( pDst != NULL );
assert( lLen > 1 );
flStep = (float)(Max - Min) / (lLen - 1);
/* Init */
pDst[0] = (float)Min;
pDst[lLen - 1] = (float)Max;
for( i = 1; i < lLen - 1; i++ )
{
pDst[i] = (float)(flStep * i + Min);
assert( pDst[i - 1] < pDst[i] );
} /* for */
assert( pDst[lLen - 2] < pDst[lLen - 1] );
} /* ats1flInitGrad */
/* End of file. */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -