Return-Path: Delivered-To: apmail-lucene-mahout-dev-archive@minotaur.apache.org Received: (qmail 76374 invoked from network); 14 Apr 2010 09:09:13 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 14 Apr 2010 09:09:13 -0000 Received: (qmail 7573 invoked by uid 500); 14 Apr 2010 09:09:12 -0000 Delivered-To: apmail-lucene-mahout-dev-archive@lucene.apache.org Received: (qmail 7534 invoked by uid 500); 14 Apr 2010 09:09:12 -0000 Mailing-List: contact mahout-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: mahout-dev@lucene.apache.org Delivered-To: mailing list mahout-dev@lucene.apache.org Received: (qmail 7462 invoked by uid 99); 14 Apr 2010 09:09:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Apr 2010 09:09:12 +0000 X-ASF-Spam-Status: No, hits=-1284.9 required=10.0 tests=ALL_TRUSTED,AWL X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Apr 2010 09:09:10 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o3E98oSP028457 for ; Wed, 14 Apr 2010 05:08:50 -0400 (EDT) Message-ID: <14389298.106551271236130391.JavaMail.jira@thor> Date: Wed, 14 Apr 2010 05:08:50 -0400 (EDT) From: "Danny Leshem (JIRA)" To: mahout-dev@lucene.apache.org Subject: [jira] Created: (MAHOUT-379) SequentialAccessSparseVector.equals does not agree with AbstractVector.equivalent MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 SequentialAccessSparseVector.equals does not agree with AbstractVector.equivalent --------------------------------------------------------------------------------- Key: MAHOUT-379 URL: https://issues.apache.org/jira/browse/MAHOUT-379 Project: Mahout Issue Type: Bug Components: Math Affects Versions: 0.4 Reporter: Danny Leshem Priority: Minor Fix For: 0.3 When a SequentialAccessSparseVector is serialized and deserialized using VectorWritable, the result vector and the original vector are equivalent, yet equals returns false. The following unit-test reproduces the problem: {code} @Test public void testSequentialAccessSparseVectorEquals() throws Exception { final Vector v = new SequentialAccessSparseVector(1); final VectorWritable vectorWritable = new VectorWritable(v); final VectorWritable vectorWritable2 = new VectorWritable(); writeAndRead(vectorWritable, vectorWritable2); final Vector v2 = vectorWritable2.get(); assertTrue(AbstractVector.equivalent(v, v2)); assertEquals(v, v2); // This line fails! } private void writeAndRead(Writable toWrite, Writable toRead) throws IOException { final ByteArrayOutputStream baos = new ByteArrayOutputStream(); final DataOutputStream dos = new DataOutputStream(baos); toWrite.write(dos); final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); final DataInputStream dis = new DataInputStream(bais); toRead.readFields(dis); } {code} -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira