improvement.
But we have a better O (VN) algorithm.O (VN) Algorithm
This algorithm uses a one-dimensional array. first look at the pseudo code:
for i=1..N for v=0..V f[v]=max{f[v],f[v-cost]+weight}
You will find that this pseudocode correspondsP01The pseudo-code only has a different loop order of v. Why is this change feasible? First, let's think about why the V = V .. 0 in p01 should be reversed. This is because we need to ensure that the
expression of cubic interpolation in two-dimensional space, and the interpolation formula can be expressed as:
G (x, y) = f (f (p00, P01, P02, p03, y), F (p10,p11, P12, P13, y), F (P20, P21, P22, P23, y), F (P30, p31, P32, P33, y), X)
The value of a g (x, y) target interpolation point can be obtained by solving the 16 parameters.
Two: Dual-cubic interpolation advantages and disadvantages
Double-cubic interpolation in the image amplification process
Utility functionsDECODEThe syntax is as follows:DECODE (value, IF1, Then1, If2,then2,if3,then3, ... else) value represents any column of any type of a table or any result that is computed. When each value is tested, if value is the result of the If1,decode function is then1, and if value equals If2,decode The result of the function is then2; In fact, multiple if/then pairs can be given. If the value result is not equal to any given pairing, the Decode result returns else. It is important to not
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.