?? dvdot.c
字號:
/*
* *************************************************************************
* * *
* * This confidential and proprietary software may be used only *
* * as authorized by a licensing agreement from the Alta Group of *
* * Cadence Design Systems, Inc. In the event of publication, the *
* * following notice is applicable: *
* * *
* * (c) COPYRIGHT 1995 ALTA GROUP OF CADENCE DESIGN SYSTEMS, INC. *
* * ALL RIGHTS RESERVED *
* * *
* * The entire notice above must be reproduced on all authorized *
* * copies. *
* * *
* *************************************************************************
*
*/
/*
* FILE: dvdot.c
* DATE: Nov 1, 1989
* RELATED FILES:
* AUTHOR: Mark Schrank
* DESCRIPTION: "c" Dvdot function
* NOTES/WARNINGS:
* REVISION HISTORY:
* Release Who Date Comments
* 2.6 John Lundell 02/23/90 Changed Macro calls to register pointers.
*/
#include "cgs.h"
/*
*---------------------------------------------------------------
* FUNCTION: Dvdot(sp_src1,sp_src2,dp_result)
* DESCRIPTION:
* Performs a dot product between src1 and src2 store the result
* in result.
*
* RETURN VALUE: The result
* NOTES/WARNINGS:
* REVISION HISTORY:
* Release Who Date Comments
* 2.6 John Lundell 02/23/90 Changed Macro calls to register pointers.
*/
double Dvdot(sp_src1, sp_src2, dp_result)
Ovector sp_src1;
Ovector sp_src2;
double *dp_result;
{
register long n = sp_src1->length;
register char *s1 = sp_src1->virtstart;
register char *s2 = sp_src2->virtstart;
register long stp1 = sp_src1->stepsize;
register long stp2 = sp_src2->stepsize;
register double result = 0.0;
while (n-- > 0) {
result += *(double *)s1 * *(double *) s2;
s1 += stp1;
s2 += stp2;
}
*dp_result = result;
return result;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -